Skip to content

Commit b659ce4

Browse files
committed
Cleaned up include dependencies on Linux through use of pkg-config.
Integrated changes from Mark Wieder and Matt Peterson to get Linux running under 64-bit. Integrated Makefile changes from Matt Peterson (added 'clean' target and added missing dependencies).
1 parent 93c5543 commit b659ce4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+656
-78
lines changed

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ server: libz libgif libjpeg libpcre libpng libopenssl libexternal libcore kernel
6767
libcairopdf:
6868
$(MAKE) -C ./thirdparty/libcairo libcairopdf
6969

70-
revpdfprinter: libcairopdf
70+
revpdfprinter: libcairopdf libcore
7171
$(MAKE) -C ./revpdfprinter revpdfprinter
7272

7373
###############################################################################
@@ -94,7 +94,7 @@ libiodbc:
9494
dbpostgresql: libpq
9595
$(MAKE) -C ./revdb dbpostgresql
9696

97-
dbmysql: libmysql libz
97+
dbmysql: libmysql libz libopenssl
9898
$(MAKE) -C ./revdb dbmysql
9999

100100
dbsqlite: libsqlite libexternal
@@ -165,6 +165,7 @@ revandroid: libexternalv1
165165
# All Targets
166166

167167
.PHONY: all clean
168+
.DEFAULT_GOAL := all
168169

169170
all: revzip server-revzip
170171
all: revxml server-revxml
@@ -173,3 +174,7 @@ all: revdb dbodbc dbsqlite dbmysql dbpostgresql
173174
all: server-revdb server-dbodbc server-dbsqlite server-dbmysql server-dbpostgresql
174175
all: development standalone installer server
175176
#
177+
178+
clean:
179+
@rm -r _build/linux _cache/linux _build/linux-x64 _cache/linux-x64
180+

engine/Makefile.common

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ CUSTOM_INCLUDES=\
1515
CUSTOM_DEPS= libkernel.a libcore.a libpng.a libpcre.a libjpeg.a $(MODE_DEPS)
1616

1717
CUSTOM_LIBS=$(MODE_LIBS) kernel core z gif png pcre jpeg openssl
18-
CUSTOM_STATIC_LIBS=stdc++ $(MODE_STATIC_LIBS)
18+
CUSTOM_STATIC_LIBS=$(MODE_STATIC_LIBS)
1919
CUSTOM_DYNAMIC_LIBS=dl X11 m Xext pthread $(MODE_DYNAMIC_LIBS)
2020

2121
CUSTOM_CCFLAGS=\
22-
-Wall -Wno-unused-variable -Wno-switch -Wno-non-virtual-dtor -fno-exceptions -fno-rtti \
22+
-Wall -Wno-unused-variable -Wno-switch -Wno-non-virtual-dtor -Wno-parentheses \
23+
-fno-exceptions -fno-rtti \
2324
-fmessage-length=0 \
2425
$(MODE_CCFLAGS)
2526

engine/Makefile.installer

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ MODE_SOURCES= \
77
MODE_DEFINES=\
88
MODE_INSTALLER
99

10-
MODE_LDFLAGS=\
11-
-Wl,--script=installer.link
10+
ifeq ($(shell gcc -dumpmachine),x86_64-linux-gnu)
11+
MODE_LDFLAGS=\
12+
-Wl,--script=installer-x64.link
13+
else
14+
MODE_LDFLAGS=\
15+
-Wl,--script=installer.link
16+
endif
1217

1318
include Makefile.common

engine/Makefile.server

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,15 @@ CUSTOM_INCLUDES=\
1717
CUSTOM_DEPS=libkernel-server.a
1818

1919
CUSTOM_LIBS=pcre png jpeg z core gif kernel-server
20-
CUSTOM_STATIC_LIBS=curl ssl crypto stdc++ rt
20+
CUSTOM_STATIC_LIBS=rt
2121
CUSTOM_DYNAMIC_LIBS=dl m
2222

23+
ifeq ($(shell gcc -dumpmachine),x86_64-linux-gnu)
24+
CUSTOM_STATIC_LIBS+=crypto-x64 ssl-x64 curl-x64
25+
else
26+
CUSTOM_STATIC_LIBS+=crypto ssl curl
27+
endif
28+
2329
CUSTOM_CCFLAGS=\
2430
-Wall -Wno-unused-variable -Wno-switch -Wno-non-virtual-dtor -fno-exceptions -fno-rtti -fno-strict-aliasing \
2531
-fmessage-length=0

engine/Makefile.standalone

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ MODE_DEPS=libkernel-standalone.a
88

99
MODE_LIBS=kernel-standalone
1010

11-
MODE_LDFLAGS=\
12-
-Wl,--script=standalone.link
11+
ifeq ($(shell gcc -dumpmachine),x86_64-linux-gnu)
12+
MODE_LDFLAGS=\
13+
-Wl,--script=standalone-x64.link
14+
else
15+
MODE_LDFLAGS=\
16+
-Wl,--script=standalone.link
17+
endif
1318

1419
include Makefile.common

engine/installer-x64.link

Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
/* This is the standard linker script (ld --verbose) from version 2.22 of x64
2+
ld. It has been modified with a rule to place the '.project' section
3+
after the .bss section to allow easy insertion of the standalone data. */
4+
5+
OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64",
6+
"elf64-x86-64")
7+
OUTPUT_ARCH(i386:x86-64)
8+
ENTRY(_start)
9+
SEARCH_DIR("/usr/x86_64-linux-gnu/lib64"); SEARCH_DIR("=/usr/local/lib/x86_64-linux-gnu"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib/x86_64-linux-gnu"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib/x86_64-linux-gnu"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
10+
SECTIONS
11+
{
12+
/* Read-only sections, merged into text segment: */
13+
PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x400000)); . = SEGMENT_START("text-segment", 0x400000) + SIZEOF_HEADERS;
14+
.interp : { *(.interp) }
15+
.note.gnu.build-id : { *(.note.gnu.build-id) }
16+
.hash : { *(.hash) }
17+
.gnu.hash : { *(.gnu.hash) }
18+
.dynsym : { *(.dynsym) }
19+
.dynstr : { *(.dynstr) }
20+
.gnu.version : { *(.gnu.version) }
21+
.gnu.version_d : { *(.gnu.version_d) }
22+
.gnu.version_r : { *(.gnu.version_r) }
23+
.rela.dyn :
24+
{
25+
*(.rela.init)
26+
*(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
27+
*(.rela.fini)
28+
*(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
29+
*(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
30+
*(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
31+
*(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
32+
*(.rela.ctors)
33+
*(.rela.dtors)
34+
*(.rela.got)
35+
*(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
36+
*(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*)
37+
*(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*)
38+
*(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*)
39+
*(.rela.ifunc)
40+
}
41+
.rela.plt :
42+
{
43+
*(.rela.plt)
44+
PROVIDE_HIDDEN (__rela_iplt_start = .);
45+
*(.rela.iplt)
46+
PROVIDE_HIDDEN (__rela_iplt_end = .);
47+
}
48+
.init :
49+
{
50+
KEEP (*(.init))
51+
} =0x90909090
52+
.plt : { *(.plt) *(.iplt) }
53+
.text :
54+
{
55+
*(.text.unlikely .text.*_unlikely)
56+
*(.text.exit .text.exit.*)
57+
*(.text.startup .text.startup.*)
58+
*(.text.hot .text.hot.*)
59+
*(.text .stub .text.* .gnu.linkonce.t.*)
60+
/* .gnu.warning sections are handled specially by elf32.em. */
61+
*(.gnu.warning)
62+
} =0x90909090
63+
.fini :
64+
{
65+
KEEP (*(.fini))
66+
} =0x90909090
67+
PROVIDE (__etext = .);
68+
PROVIDE (_etext = .);
69+
PROVIDE (etext = .);
70+
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
71+
.rodata1 : { *(.rodata1) }
72+
.eh_frame_hdr : { *(.eh_frame_hdr) }
73+
.eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
74+
.gcc_except_table : ONLY_IF_RO { *(.gcc_except_table
75+
.gcc_except_table.*) }
76+
/* These sections are generated by the Sun/Oracle C++ compiler. */
77+
.exception_ranges : ONLY_IF_RO { *(.exception_ranges
78+
.exception_ranges*) }
79+
/* Adjust the address for the data segment. We want to adjust up to
80+
the same address within the page on the next page up. */
81+
. = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
82+
/* Exception handling */
83+
.eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
84+
.gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
85+
.exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) }
86+
/* Thread Local Storage sections */
87+
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
88+
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
89+
.preinit_array :
90+
{
91+
PROVIDE_HIDDEN (__preinit_array_start = .);
92+
KEEP (*(.preinit_array))
93+
PROVIDE_HIDDEN (__preinit_array_end = .);
94+
}
95+
.init_array :
96+
{
97+
PROVIDE_HIDDEN (__init_array_start = .);
98+
KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
99+
KEEP (*(.init_array))
100+
KEEP (*(EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
101+
PROVIDE_HIDDEN (__init_array_end = .);
102+
}
103+
.fini_array :
104+
{
105+
PROVIDE_HIDDEN (__fini_array_start = .);
106+
KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
107+
KEEP (*(.fini_array))
108+
KEEP (*(EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
109+
PROVIDE_HIDDEN (__fini_array_end = .);
110+
}
111+
.ctors :
112+
{
113+
/* gcc uses crtbegin.o to find the start of
114+
the constructors, so we make sure it is
115+
first. Because this is a wildcard, it
116+
doesn't matter if the user does not
117+
actually link against crtbegin.o; the
118+
linker won't look for a file to match a
119+
wildcard. The wildcard also means that it
120+
doesn't matter which directory crtbegin.o
121+
is in. */
122+
KEEP (*crtbegin.o(.ctors))
123+
KEEP (*crtbegin?.o(.ctors))
124+
/* We don't want to include the .ctor section from
125+
the crtend.o file until after the sorted ctors.
126+
The .ctor section from the crtend file contains the
127+
end of ctors marker and it must be last */
128+
KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
129+
KEEP (*(SORT(.ctors.*)))
130+
KEEP (*(.ctors))
131+
}
132+
.dtors :
133+
{
134+
KEEP (*crtbegin.o(.dtors))
135+
KEEP (*crtbegin?.o(.dtors))
136+
KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
137+
KEEP (*(SORT(.dtors.*)))
138+
KEEP (*(.dtors))
139+
}
140+
.jcr : { KEEP (*(.jcr)) }
141+
.data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
142+
.dynamic : { *(.dynamic) }
143+
.got : { *(.got) *(.igot) }
144+
. = DATA_SEGMENT_RELRO_END (24, .);
145+
.got.plt : { *(.got.plt) *(.igot.plt) }
146+
.data :
147+
{
148+
*(.data .data.* .gnu.linkonce.d.*)
149+
SORT(CONSTRUCTORS)
150+
}
151+
.data1 : { *(.data1) }
152+
_edata = .; PROVIDE (edata = .);
153+
__bss_start = .;
154+
.bss :
155+
{
156+
*(.dynbss)
157+
*(.bss .bss.* .gnu.linkonce.b.*)
158+
*(COMMON)
159+
/* Align here to ensure that the .bss section occupies space up to
160+
_end. Align after .bss to ensure correct alignment even if the
161+
.bss section disappears because there are no input sections.
162+
FIXME: Why do we need it? When there is no .bss section, we don't
163+
pad the .data section. */
164+
. = ALIGN(. != 0 ? 64 / 8 : 1);
165+
}
166+
.lbss :
167+
{
168+
*(.dynlbss)
169+
*(.lbss .lbss.* .gnu.linkonce.lb.*)
170+
*(LARGE_COMMON)
171+
}
172+
. = ALIGN(64 / 8);
173+
.lrodata ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) :
174+
{
175+
*(.lrodata .lrodata.* .gnu.linkonce.lr.*)
176+
}
177+
.ldata ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) :
178+
{
179+
*(.ldata .ldata.* .gnu.linkonce.l.*)
180+
. = ALIGN(. != 0 ? 64 / 8 : 1);
181+
}
182+
. = ALIGN(64 / 8);
183+
.payload :
184+
{
185+
*(.payload)
186+
}
187+
. = ALIGN(64 / 8);
188+
.project :
189+
{
190+
*(.project)
191+
}
192+
. = ALIGN(64 / 8);
193+
_end = .; PROVIDE (end = .);
194+
. = DATA_SEGMENT_END (.);
195+
/* Stabs debugging sections. */
196+
.stab 0 : { *(.stab) }
197+
.stabstr 0 : { *(.stabstr) }
198+
.stab.excl 0 : { *(.stab.excl) }
199+
.stab.exclstr 0 : { *(.stab.exclstr) }
200+
.stab.index 0 : { *(.stab.index) }
201+
.stab.indexstr 0 : { *(.stab.indexstr) }
202+
.comment 0 : { *(.comment) }
203+
/* DWARF debug sections.
204+
Symbols in the DWARF debugging sections are relative to the beginning
205+
of the section so we begin them at 0. */
206+
/* DWARF 1 */
207+
.debug 0 : { *(.debug) }
208+
.line 0 : { *(.line) }
209+
/* GNU DWARF 1 extensions */
210+
.debug_srcinfo 0 : { *(.debug_srcinfo) }
211+
.debug_sfnames 0 : { *(.debug_sfnames) }
212+
/* DWARF 1.1 and DWARF 2 */
213+
.debug_aranges 0 : { *(.debug_aranges) }
214+
.debug_pubnames 0 : { *(.debug_pubnames) }
215+
/* DWARF 2 */
216+
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
217+
.debug_abbrev 0 : { *(.debug_abbrev) }
218+
.debug_line 0 : { *(.debug_line) }
219+
.debug_frame 0 : { *(.debug_frame) }
220+
.debug_str 0 : { *(.debug_str) }
221+
.debug_loc 0 : { *(.debug_loc) }
222+
.debug_macinfo 0 : { *(.debug_macinfo) }
223+
/* SGI/MIPS DWARF 2 extensions */
224+
.debug_weaknames 0 : { *(.debug_weaknames) }
225+
.debug_funcnames 0 : { *(.debug_funcnames) }
226+
.debug_typenames 0 : { *(.debug_typenames) }
227+
.debug_varnames 0 : { *(.debug_varnames) }
228+
/* DWARF 3 */
229+
.debug_pubtypes 0 : { *(.debug_pubtypes) }
230+
.debug_ranges 0 : { *(.debug_ranges) }
231+
.gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
232+
/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
233+
}

engine/src/bitmapeffect.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,20 +1388,25 @@ static MCBitmapEffectCompositeCallback MCBitmapEffectChooseCompositer(MCBitmapEf
13881388
return NULL;
13891389
}
13901390

1391+
// MW-2013-02-05: [[ x64 ]] Change strides to be signed to avoid problems with
1392+
// ptr arithmetic and promotions in 64-bit.
13911393
static void MCBitmapEffectRender(MCBitmapEffectRenderState& state, MCBitmapEffectLayer& dst, MCBitmapEffectLayer& src)
13921394
{
13931395
// Compute the dst ptr/stride in pixels.
1394-
uint32_t t_dst_stride, *t_dst_pixels;
1396+
int32_t t_dst_stride;
1397+
uint32_t *t_dst_pixels;
13951398
t_dst_stride = dst . stride / 4;
13961399
t_dst_pixels = (uint4 *)dst . bits + t_dst_stride * (state . region . y - dst . bounds . y) + (state . region . x - dst . bounds . x);
13971400

13981401
// Compute the blur src ptr/stride in pixels.
1399-
uint32_t t_blur_src_stride, *t_blur_src_pixels;
1402+
int32_t t_blur_src_stride;
1403+
uint32_t *t_blur_src_pixels;
14001404
t_blur_src_stride = src . stride / 4;
14011405
t_blur_src_pixels = (uint4 *)src . bits + t_blur_src_stride * (state . blur_rect . y - src . bounds . y) + (state . blur_rect . x - src . bounds . x);
14021406

14031407
// Compute the src ptr/stride in pixels.
1404-
uint32_t t_src_stride, *t_src_pixels;
1408+
int32_t t_src_stride;
1409+
uint32_t *t_src_pixels;
14051410
t_src_stride = src . stride / 4;
14061411
t_src_pixels = (uint4 *)src . bits + t_src_stride * (state . region . y - src . bounds . y) + (state . region . x - src . bounds . x);
14071412

0 commit comments

Comments
 (0)