VirtualBox

Opened 10 years ago

Closed 9 years ago

#13199 closed defect (invalid)

VirtualBox OSE >= 4.3.12 compilation error

Reported by: Jan Palus Owned by:
Component: other Version: VirtualBox 4.3.12
Keywords: Cc:
Guest type: other Host type: Linux

Description

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/mangling.run"
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/mangling.run] Error 1

Not sure what exactly is relevant:

gcc -v
Reading specs from /usr/lib64/gcc/x86_64-pld-linux/4.8.3/specs
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-pld-linux/4.8.3/lto-wrapper
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=http://bugs.pld-linux.org x86_64-pld-linux
Thread model: posix
gcc version 4.8.3 20140522 (release) (PLD-Linux)
nm -V
GNU nm (Linux/GNU Binutils) 2.24.51.0.3.20140127

There seems to be similar issue reported in gentoo: https://bugs.gentoo.org/show_bug.cgi?id=514658

Change History (7)

comment:2 by dev-zero, 10 years ago

Is there a way we can help debugging this issue?

comment:4 by Frank Mehnert, 10 years ago

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 by Valery Ushakov, 9 years ago

Lest its lost - https://www.virtualbox.org/pipermail/vbox-dev/2015-February/012863.html

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 .data.rel.ro.local, 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.

in reply to:  5 comment:6 by Jan Palus, 9 years ago

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 by Valery Ushakov, 9 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use