VirtualBox

Changeset 72137 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 7, 2018 12:31:41 PM (7 years ago)
Author:
vboxsync
Message:

Some more fixes for building backwards-compatible Linux Additions binaries.
bugref:9112: Linux Additions: fix building binaries for older Linux user space

  • Only link with --hash-style=sysv where that option is supported.
  • Fix chk_stubs.c build mess by building it as a normal source file. It does

not need to come after the static libraries using its symbols on the command
line as it is an object file, not a library, and therefore its symbols are
always pulled in.

Location:
trunk/src/VBox/Additions/x11/VBoxClient
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/VBoxClient/Makefile.kmk

    r72124 r72137  
    3939        display-svga.cpp \
    4040        display-svga-x11.cpp
     41VBoxClient_SOURCES.linux = \
     42        chk_stubs.c
    4143VBoxClient_LIBPATH = \
    4244        $(VBOX_LIBPATH32_X11)
     
    6870        supc++ \
    6971        gcc_eh
    70 # This has to be in LIBS, so as to be linked in after supc++ and gcc_eh, which
    71 # depend on the symbols it provides.  Static supc++ and gcc_eh on at least
    72 # Ubuntu 17.04 contain references to __sprintf_chk and __stack_chk_fail.
    73 # Furthermore, they contain references to memcpy, which needs to be resolved
    74 # to memcpy@GLIBC_2.2.5, which we solve in a not-very-satisfactory way with a
    75 # wrapper.
    76 ##
    77 ## @todo r=bird: With all due respect, what are you smoking??  The above does not compute,
    78 ## so there is either some other reason which you fail to describe or you've got it all wrong.
    79 ## It cannot be for reasons of symbol resolution, because puttin chk_stubs.c in SOURCES would
    80 ## make absolutely sure the symbols in it would always be part of the link and present in the
    81 ## symbol table before any library searching is done.  I cannot see how the --wrap-memcpy could
    82 ## have anything to do with this either.
    83 ##
    84 ## Your query on IRC why chk_stubs.c is treated as C++, that's because the linker is called g++.
    85 ##
    86 ## Please explain why this nonsese is required or I will revert it and leave you deal with the consequences.
    87 ##
    88 ## -bird
    89 ##
     72
     73# This forces the memcpy references in the static libraries to go to
     74# __wrap_memcpy, which we can wrap around memcpy@GLIBC_2.2.5.  I do not know
     75# how else to do that without recompiling or implementing our own memcpy.
    9076ifeq ($(KBUILD_TARGET),linux)
    91 VBoxClient_LIBS    += \
    92         $(PATH_ROOT)/src/VBox/Additions/x11/VBoxClient/chk_stubs.c
    9377VBoxClient_LDFLAGS.amd64 += \
    9478        -Wl,--wrap=memcpy
  • trunk/src/VBox/Additions/x11/VBoxClient/chk_stubs.c

    r72122 r72137  
    5050 * supc++ and gcc_eh contain references which we cannot change. */
    5151
    52 #ifdef __cplusplus
    53 extern "C" void *__wrap_memcpy(void *dest, const void *src, size_t n);
    54 #endif
     52extern void *__wrap_memcpy(void *dest, const void *src, size_t n);
    5553
    5654asm (".symver memcpy, memcpy@GLIBC_2.2.5");
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette