Bug 325439 (MONO82772) - mono fails to build on PIE enabled systems
Summary: mono fails to build on PIE enabled systems
Status: RESOLVED FIXED
Alias: MONO82772
Product: Mono: Runtime
Classification: Mono
Component: misc (show other bugs)
Version: 1.2
Hardware: Other Other
: P3 - Medium : Major
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2007-09-09 23:32 UTC by Jerzy Bartuszek
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Allow mono-compiler.h to trigger on __PIC__ for PIC code (515 bytes, patch)
2007-09-09 23:33 UTC, Thomas Wiest
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 20:52:58 UTC


---- Reported by jurek@gentoo.org 2007-09-09 16:32:59 MST ----

Description of Problem:

mono appears to fail linking of libmono-static.a if compiled
with pie enabled:

x86_64-pc-linux-gnu-gcc -I../.. -I../../libgc/include -I/usr/include/glib-2.0
-I/usr/lib64/glib-2.0/include -pthread -I/usr/include/glib-2.0
-I/usr/lib64/glib-2.0/include -march=opteron -O2 -pipe -fno-strict-aliasing
-Wdeclaration-after-statement -g -Wall -Wunused -Wmissing-prototypes
-Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes
-Wnested-externs -Wpointer-arith -Wno-cast-qual -Wcast-align -Wwrite-strings
-mno-tls-direct-seg-refs -Wl,-version-script=./ldscript.mono -o mono main.o
-pthread -Wl,--export-dynamic -Wl,--export-dynamic  ./.libs/libmono-static.a
/usr/lib64/libgthread-2.0.so /usr/lib64/libgmodule-2.0.so -ldl
/usr/lib64/libglib-2.0.so -lrt -lpthread -lm
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.6/../../../../x86_64-pc-linux-gnu/bin/ld:
./.libs/libmono-static.a(threads.o): relocation R_X86_64_TPOFF32 against `a
local symbol' can not be used when making a shared object; recompile with -fPIC
./.libs/libmono-static.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[4]: *** [mono] Error 1
make[4]: Leaving directory
`/var/tmp/portage/mono-1.2.2.1/work/mono-1.2.2.1/mono/mini'
make[3]: *** [all] Error 2

this also applies to newer mono versions. Here's the original gentoo
bugzilla entry:

http://bugs.gentoo.org/show_bug.cgi?id=165547

you can read about PIE/SSP here:

http://www.gentoo.org/proj/en/hardened/pie-ssp.xml

a patch (which probably needs more testing) fixing this problem will follow



---- Additional Comments From jurek@gentoo.org 2007-09-09 16:33:53 MST ----

Created an attachment (id=172649)
Allow mono-compiler.h to trigger on __PIC__ for PIC code




---- Additional Comments From vargaz@gmail.com 2007-09-09 18:20:14 MST ----

The patch is now in SVN.


Imported an attachment (id=172649)

Unknown operating system unknown. Setting to default OS "Other".