Ticket #13199 (closed defect: invalid)

Opened 4 years ago

Last modified 3 years ago

VirtualBox OSE >= 4.3.12 compilation error

Reported by: jpalus Owned by:
Priority: minor Component: other
Version: VirtualBox 4.3.12 Keywords:
Cc: Guest type: other
Host type: Linux


Starting with VirtualBox 4.3.12 (affects also 4.3.14), VirtualBox stopped compiling from source with error on mangling test:

kBuild: IPRT: Testing mangling using nm... 
nm /mnt/hdd/system/jan/rpm/BUILD/VirtualBox-4.3.14/out/linux.amd64/release/obj/RuntimeR3/RuntimeR3.a /mnt/hdd/system/jan/rpm/BUILD/VirtualBox-4.3.14/out/linux.amd64/release/obj/RuntimeR0/RuntimeR0.a /mnt/hdd/system/jan/rpm/BUILD/VirtualBox-4.3.14/out/linux.amd64/release/obj/RuntimeRC/RuntimeRC.a  2> /dev/null \
	| /usr/bin/kmk_sed -n \
		-e 's/^[0-9a-f][0-9a-f]* //' \
		-e '/^[TUDB] /!d' \
		-e 's/^. //' \
		-e '/^g_cchrt/d'\
		-e '/^g_frt/d'\
		-e '/^g_offrt/d'\
		-e '/^g_pfnrt/d'\
		-e '/^g_rt/d'\
		-e '/^g_szrt/d'\
		-e '/^g_ProcessSelf/d'\
		-e '/^g_u64ProgramStart/d'\
		-e '/^g_enmProcessPriority/d'\
		-e '/^g_hDbgModStrCache/d'\
		-e '/^g_pfnR0Darwin/d'\
		-e '/^g_pDarwinLockGroup/d'\
		-e '/^RTDBusLoadLib/d' \
		-e '/^RT/p' \
		-e '/^g_/p' \
	| /usr/bin/kmk_sed -nf "/mnt/hdd/system/jan/rpm/BUILD/VirtualBox-4.3.14/out/linux.amd64/release/obj/Runtime/"
error: Missing # define g_kLdrRdrFileOps                               RT_MANGLER(g_kLdrRdrFileOps)
kmk: *** [/mnt/hdd/system/jan/rpm/BUILD/VirtualBox-4.3.14/out/linux.amd64/release/obj/Runtime/] Error 1

Not sure what exactly is relevant:

gcc -v
Reading specs from /usr/lib64/gcc/x86_64-pld-linux/4.8.3/specs
Target: x86_64-pld-linux
Configured with: ../configure --prefix=/usr --with-local-prefix=/usr/local --libdir=/usr/lib64 --libexecdir=/usr/lib64 --infodir=/usr/share/info --mandir=/usr/share/man --x-libraries=/usr/lib64 --enable-bootstrap --disable-build-with-cxx --disable-build-poststage1-with-cxx --enable-c99 --enable-checking=release --disable-cld --enable-cmath --enable-decimal-float --enable-gnu-unique-object --enable-initfini-array --enable-languages=c,c++,fortran,objc,obj-c++,ada,java,go --enable-libgomp --enable-libitm --enable-libmudflap --enable-linker-build-id --enable-linux-futex --enable-long-long --enable-nls --enable-lto --enable-plugin --enable-shared --enable-threads=posix --disable-werror --with-cloog --with-demangler-in-ld --with-gnu-as --with-gnu-ld --with-linker-hash-style=gnu --with-long-double-128 --with-ppl --disable-ppl-version-check --with-slibdir=/lib64 --without-system-libunwind --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-libstdcxx-threads --enable-libstdcxx-time=rt --enable-libstdcxx-visibility --enable-symvers=gnu --with-gxx-include-dir=/usr/include/c++/4.8.3 --disable-gconf-peer --enable-gtk-cairo --enable-java-awt=xlib,gtk --enable-jni --enable-libgcj --enable-libgcj-multifile --enable-libgcj-database --disable-libjava-multilib --enable-static-libjava --enable-xmlj --with-pkgversion=PLD-Linux --with-bugurl= x86_64-pld-linux
Thread model: posix
gcc version 4.8.3 20140522 (release) (PLD-Linux)
nm -V
GNU nm (Linux/GNU Binutils)

There seems to be similar issue reported in gentoo:

Change History

comment:2 Changed 4 years ago by dev-zero

Is there a way we can help debugging this issue?

comment:3 Changed 4 years ago by dev-zero

comment:4 Changed 4 years ago by frank

This works fine here on Debian/64 with gcc-4.8 and gcc-4.9. If I only could reproduce this problem without installing Gentoo...

comment:5 follow-up: ↓ 6 Changed 3 years ago by vushakov

Lest its lost -

The fallout from that PLD-linux patch is text relocs in a shared library. The patch fixes "static" case, but breaks the dynamic case (where it still forces the variable into rodata).

To quote a summary from my mail above:

Without the PLD-linux patch g_kLdrRdrFileOps is in, so the file must have been compiled PIC. And looking at the full PLD build log (linked above) I see that out/linux.amd64/release/obj/RuntimeR3/common/ldr/ldrkStuff.o is indeed built with -fPIC. That file, part of RuntimeR3.a, is NOT built as PIC in stock VBox build (RuntimeR3_TEMPLATE = VBoxR3Static).

If building it as PIC is not intended, than you should find the bug in your makefiles or makefile patches that causes -fPIC to be added there. If building it as PIC is intended - you need to adjust that visibility/mangling check to reflect the new reality.

comment:6 in reply to: ↑ 5 Changed 3 years ago by jpalus

Thanks a lot Valery, -fPIC enforced by global C*FLAGS were indeed the root cause in case of PLD. Issue can be closed.

comment:7 Changed 3 years ago by vushakov

  • Status changed from new to closed
  • Resolution set to invalid
Note: See TracTickets for help on using tickets.
ContactPrivacy policyTerms of Use