MCS [build] mcs.exe AOT [build] mscorlib.dll.so ld: /var/tmp/portage/dev-lang/mono-4.9.0.729/temp/mono_aot_tiaKzD.o: relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC ld: final link failed: Nonrepresentable section on output AOT of image ./../../class/lib/build//mscorlib.dll failed. Mono Ahead of Time compiler - compiling assembly /var/tmp/portage/dev-lang/mono-4.9.0.729/work/mono-4.9.0-abi_x86_32.x86/mcs/class/lib/build/mscorlib.dll $ cat emerge-info.txt ----------------------------------------------------------------- This is an unstable amd64 chroot image (named amd64-plasma-unstable_20161121-102134) at a hardened host acting as a tinderbox. ----------------------------------------------------------------- USE flags ... ... in make.conf: USE=" pax_kernel xtpax -cdinstall -oci8 -bindist ssp aes-ni cairo cdb cddb consolekit curl dbus ext4 fitz -graphtft gtk3 -ithreads lapack ldap mikmod minizip mono mta odbc opencv perl png qt5 secure-delete -ssh thinkpad -truetype ufed -usb v4l -vala zip" ... in /etc/portage/package.use/*: mail-mta/ssmtp mta ssl net-misc/wget ssl app-editors/xemacs -nopie dev-db/sqlite secure-delete dev-lang/python sqlite dev-qt/qtsql sqlite mail-client/thunderbird -pulseaudio system-icu media-libs/libvpx postproc media-libs/libpng apng media-sound/pulseaudio alsa media-video/ffmpeg sdl sys-libs/ntdb python sys-libs/tdb python sys-libs/tevent python x11-libs/cairo X x11-libs/libxcb xkb www-client/firefox -pulseaudio system-icu app-crypt/mit-krb5 -pkinit media-video/ffmpeg -sdl sys-libs/zlib minizip x11-base/xorg-server glamor -minimal app-crypt/pinentry -qt4 app-editors/emacs -dbus -gtk -gtk3 -ssl -svg app-text/docbook-xsl-stylesheets -ruby app-text/xmlto -latex dev-libs/boehm-gc threads dev-libs/libpcre pcre16 dev-lang/python threads dev-qt/qtgui egl eglfs dev-util/cmake -qt4 -qt5 dev-vcs/git -gtk -perl gnome-base/librsvg -tools media-libs/mesa -vaapi -video_cards_radeonsi -video_cards_radeon net-nds/openldap -sasl sys-apps/kmod tools sys-libs/ncurses -gpm x11-libs/gtk+ -cups net-misc/openssh ssl sys-apps/busybox -pam dev-lang/mono minimal net-misc/iputils -caps -filecaps >=media-libs/harfbuzz-1.3.3 truetype entries in /etc/portage/package.unmask/*: ~sys-apps/sandbox-2.11 ----------------------------------------------------------------- gcc-config -l: [1] x86_64-pc-linux-gnu-5.4.0 * llvm-config --version: 3.9.0 Available Python interpreters, in order of preference: [1] python2.7 [2] python3.4 [3] python3.5 (fallback) Available Ruby profiles: [1] ruby20 (with Rubygems) [2] ruby21 (with Rubygems) * java-config: The following VMs are available for generation-2: ----------------------------------------------------------------- Portage 2.3.2 (python 2.7.12-final-0, default/linux/amd64/13.0/desktop/plasma, gcc-5.4.0, glibc-2.23-r3, 4.8.9-hardened x86_64) ================================================================= System Settings ================================================================= System uname: Linux-4.8.9-hardened-x86_64-Intel-R-_Core-TM-_i7-3930K_CPU_@_3.20GHz-with-gentoo-2.3 KiB Mem: 65285560 total, 4430368 free KiB Swap: 67108860 total, 67094828 free Timestamp of repository gentoo: Thu, 24 Nov 2016 07:46:13 +0000 sh bash 4.4_p5 ld GNU ld (Gentoo 2.27 p1.0) 2.27 app-shells/bash: 4.4_p5::gentoo dev-java/java-config: 2.2.0-r3::gentoo dev-lang/perl: 5.24.1_rc4::gentoo dev-lang/python: 2.7.12::gentoo, 3.4.5::gentoo, 3.5.2::gentoo dev-util/cmake: 3.7.0::gentoo dev-util/pkgconfig: 0.29.1::gentoo sys-apps/baselayout: 2.3::gentoo sys-apps/openrc: 0.22.4::gentoo sys-apps/sandbox: 2.11-r3::gentoo sys-devel/autoconf: 2.13::gentoo, 2.69-r2::gentoo sys-devel/automake: 1.11.6-r2::gentoo, 1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo sys-devel/binutils: 2.27::gentoo sys-devel/gcc: 5.4.0::gentoo sys-devel/gcc-config: 1.8-r1::gentoo sys-devel/libtool: 2.4.6-r2::gentoo sys-devel/make: 4.2.1::gentoo sys-kernel/linux-headers: 4.8::gentoo (virtual/os-headers) sys-libs/glibc: 2.23-r3::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: 1 tinderbox location: /tmp/tb/data/portage masters: gentoo priority: 2 local location: /usr/local/portage masters: gentoo priority: 3 ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="*" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/config" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-march=native -O2 -pipe" DISTDIR="/var/tmp/distfiles" EMERGE_DEFAULT_OPTS="--verbose --verbose-conflicts --color=n --nospinner --tree --quiet-build" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox parallel-fetch preserve-libs protect-owned sandbox sfperms strict test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://ftp.uni-erlangen.de/pub/mirrors/gentoo rsync://mirror.netcologne.de/gentoo/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gor.bytemark.co.uk/gentoo/ rsync://ftp.snt.utwente.nl/gentoo" LANG="en_US.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j1" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" PORTAGE_TMPDIR="/var/tmp" USE="X a52 aac acl acpi aes-ni alsa amd64 berkdb bluetooth branding bzip2 cairo cdb cdda cddb cdr cli consolekit cracklib crypt cups curl cxx dbus declarative dri dts dvd dvdr emboss encode exif ext4 fam firefox fitz flac fortran gdbm gif glamor gpm gtk gtk3 iconv ipv6 jpeg kde kipi lapack lcms ldap libnotify mad mikmod minizip mmx mmxext mng modules mono mp3 mp4 mpeg mta multilib ncurses nls nptl odbc ogg opencv opengl openmp pam pango pax_kernel pcre pdf perl phonon plasma png policykit ppds qml qt3support qt4 qt5 readline sdl seccomp secure-delete semantic-desktop session spell sse sse2 ssl ssp startup-notification svg tcpd thinkpad tiff udev udisks ufed unicode upower v4l vorbis widgets wxwidgets x264 xattr xcb xcomposite xinerama xml xscreensaver xtpax xv xvid zip zlib" ABI_X86="32 64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" L10N="bn-IN" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Created attachment 454218 [details] config.log
Created attachment 454220 [details] dev-lang:mono-4.9.0.729:20161124-101440.log.bz2
Created attachment 454222 [details] emerge-history.txt
Created attachment 454224 [details] environment
I'm unsure if the ebuild [s|c]hould check for -fPIC before ?
only this version affected? can you catch the same issue on previous version?
(In reply to Cynede from comment #6) yes, 4.4.1.0 and 4.6.1.5 gave similar errors
Seems to be an issue with binutils-2.27; it builds successfully with 2.26.1.
An observation: it's an x86_32 build on amd64 host and yet mono claims to call as/ld directly without any options complaining about 64-bit relocations: ld: /var/tmp/portage/dev-lang/mono-4.9.0.729/temp/mono_aot_tiaKzD.o: relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC ld: final link failed: Nonrepresentable section on output Executing the native assembler: "as" -o /var/tmp/portage/dev-lang/mono-4.9.0.729/temp/mono_aot_tiaKzD.o /var/tmp/portage/dev-lang/mono-4.9.0.729/temp/mono_aot_tiaKzD Executing the native linker: "ld" -shared -o /var/tmp/portage/dev-lang/mono-4.9.0.729/work/mono-4.9.0-abi_x86_32.x86/mcs/class/lib/build/mscorlib.dll.so.tmp /var/tmp/portage/dev-lang/mono-4 .9.0.729/temp/mono_aot_tiaKzD.o Is mono supposed to do it or should it actually use gcc wrapper with respective -m32/64 and -march options?
Here is minimal complete .S file on which binutils-2.26.1 survives and 2.27 doesn't: # bug.S .bss 0 .local bss_foo .type bss_foo,@object bss_foo: .data 0 foo: .globl foo .type foo,@object .long bss_foo Test as: $ as bug.S -o bug.o $ ld -shared bug.o -o bug.dll ld: bug.o: relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC ld: final link failed: Nonrepresentable section on output The real bug here is that bss_foo is an absolute 64-bit address while .long is a 32-bit storage in gas-speek. It should either be an offset '.long bss_foo - .' or a '.quad' storage. I presume mono generates that assembly file directy. The real mono-generated(?) assembly looks like that: .bss 0 .balign 8 .local mono_aot_mscorlib_got .type mono_aot_mscorlib_got,@object mono_aot_mscorlib_got: .skip 63680 ... .data 0 .balign 8 mono_aot_file_info: .globl mono_aot_file_info .type mono_aot_file_info,@object .long 137,0 .balign 4 .long mono_aot_mscorlib_got .balign 4 .long 0
bugtracker for binutils: https://sourceware.org/bugzilla/ (that was written on page https://www.gnu.org/software/binutils/ which is homepage of binutils project) I didn't found regression bug https://sourceware.org/bugzilla/buglist.cgi?bug_status=__all__&order=bug_id%20DESC&product=binutils
(In reply to Arsen Shnurkov from comment #11) > bugtracker for binutils: > https://sourceware.org/bugzilla/ > (that was written on page > https://www.gnu.org/software/binutils/ which is homepage of binutils project) > > I didn't found regression bug > https://sourceware.org/bugzilla/buglist. > cgi?bug_status=__all__&order=bug_id%20DESC&product=binutils I don't think failure to fit 64-bit symbol relocation into 32-bit .data is a binutils bug. It's likely a mono bug.
I've poked a bit more into source of '.long' bit. It's generated by image-writer.c which is built as a 32-bit executable: ../../doltlibtool --tag=CC --mode=compile x86_64-pc-linux-gnu-gcc -m32 -DHAVE_CONFIG_H -I. -I../.. -I../../libgc/include -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP -DUSE_MUNMAP -g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value -Wno-attributes -D_FILE_OFFSET_BITS=64 -DUSE_COMPILER_TLS -I../.. -I../../eglib/src -I../../eglib/src -fvisibility=hidden -march=corei7-avx -mtune=corei7-avx -O2 -pipe -fdiagnostics-show-option -frecord-gcc-switches -std=gnu99 -fno-strict-aliasing -fwrapv -Wno-zero-length-array -DMONO_DLL_EXPORT -Wno-unused-but-set-variable -g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value -Wno-attributes -Werror-implicit-function-declaration -c -o libmini_static_la-image-writer.lo `test -f 'image-writer.c' || echo './'`image-writer.c And is supposed to emit assembly buildable by 32-bit assembler/linker (snippet from image-writer.c): #if (defined(TARGET_AMD64) || defined(TARGET_POWERPC64)) && !defined(__mono_ilp32__) #define AS_POINTER_DIRECTIVE ".quad" #elif defined(TARGET_ARM64) #ifdef TARGET_ASM_APPLE #define AS_POINTER_DIRECTIVE ".quad" #else #define AS_POINTER_DIRECTIVE ".xword" #endif #else #define AS_POINTER_DIRECTIVE ".long" #endif Our target is TARGET_X86 in 32-bit ABI branch.
Thus one of the workarounds is not to build 32-bit ABI for mono: ABI_X86=64 emerge -1 mono +mva who added multilib support for mono.
Hopefully fixed (or rather worked around in style of other checks) as: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7a0e31adf6af28adf3c8709e542ecf7039cb5942 Thanks!
*** Bug 595242 has been marked as a duplicate of this bug. ***
This bug is present in dev-lang/mono-4.4.1.0 with binutils 2.28 again. please reopen
(In reply to Fabian Henze from comment #17) > This bug is present in dev-lang/mono-4.4.1.0 with binutils 2.28 again. > please reopen You should be able to reopen bugs yourself. The fix was applied to mono-4.9 and upper thus it makes sense mono was broken when binutils-2.28 was stabilized.
(In reply to Sergei Trofimovich from comment #18) > You should be able to reopen bugs yourself. Maybe I'm blind, but I don't see an option to do so.
Quite puzzled by this one, I've tried a few combinations of how to solve it (Mainly by disabling multilib as per: using MAKEOPTS="-j1 to disable parallel-build & FEATURES="-sandbox -usersandbox") Thanks! No clue whatsoever what is making it fail ;-)
Created attachment 503112 [details, diff] Patch to handle newer DDJVU API They renamed a field starting in API version 22; the behavior of the field is identical. #defines were also added for the values that can go in the field, so I use those on the newer API.
Sorry, I attached the patch to the wrong bug.
Created attachment 508982 [details, diff] mono-4.4.1.0 reloaction failure patch I've adapted the mono-4.8.0.371 patch to work with mono-4.4.1.0. Using this patch allows me to build mono-4.4.1.0.
What about this bug? mono-4.4.1.0 is marked as stable, and gcc:6.4.0 is also stable, and 17.0 profile appeared in news more than month ago, and required PIC. In summary, all of this caused the broken compilation of stable package in portage tree.
*** Bug 642142 has been marked as a duplicate of this bug. ***
I have encountered the same problem when installing the mono 4.4.1 and the patch from the comment 23 has fixed the issue.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5127c755e4cb6a810f81eb38777e1d7917695f9c commit 5127c755e4cb6a810f81eb38777e1d7917695f9c Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2018-03-30 17:25:39 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2018-03-30 17:26:42 +0000 dev-lang/mono: fix 32-bit build on amd64, bug #600664 It's a backport of https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7a0e31adf6af28adf3c8709e542ecf7039cb5942 Reported-by: Toralf Förster Fixed-by: Eric Hermes Closes: https://bugs.gentoo.org/600664 Package-Manager: Portage-2.3.26, Repoman-2.3.7 dev-lang/mono/files/mono-4.4.1.0-x86_32.patch | 20 ++++++++++++++++++++ dev-lang/mono/mono-4.4.1.0.ebuild | 4 +++- 2 files changed, 23 insertions(+), 1 deletion(-)