VirtualBox

Changeset 71694 in vbox


Ignore:
Timestamp:
Apr 6, 2018 8:27:41 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
121784
Message:

Make building Linux Additions compatible with old GLIBC versions default.
bugref:9112: Linux Additions: fix building binaries for older Linux user space
Remove VBOX_WITH_OLD_GLIBC_SUPPORT as a separate build option and apply it to
Additions binaries (and only them) by default.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r71558 r71694  
    28512851        -fno-sanitize=vptr \
    28522852        -fno-common \
    2853         -static-libasan
     2853        -include sanitizer/lsan_interface.h \
     2854        -DVBOX_WITH_GCC_SANITIZER
    28542855else
    28552856 VBOX_GCC_SANITIZER_FLAGS =
    2856 endif
    2857 
    2858 # -libasan-static is currently not supported in combination with -no-undefined.
    2859 ifdef VBOX_WITH_GCC_SANITIZER
    2860  VBOX_GCC_NO_UNDEFINED    :=
    2861  VBOX_GCC_NO_UNDEFINED_R0 :=
    2862 else
    2863  VBOX_GCC_NO_UNDEFINED    := -Wl,--no-undefined
    2864  VBOX_GCC_NO_UNDEFINED_R0 := -no-undefined
    28652857endif
    28662858
     
    42604252        $(QUIET)$$(if $$(eq $$(symvers_$(module)_dep),),,\
    42614253$$(CP) $$(symvers_$(module)_dep) "$$(PATH_TARGET)/tst$(module)_mod/Module.symvers")
    4262         + $(QUIET)make KBUILD_VERBOSE=$(KBUILD_VERBOSE) KERN_DIR=$(KERN_DIR) $(if-expr $(KMK_OPTS_JOBS) != 1,JOBS=$(KMK_OPTS_JOBS),) -C $$(PATH_TARGET)/tst$(module)_mod \
     4254        + $(QUIET)make KBUILD_VERBOSE=$(KBUILD_VERBOSE) KERN_DIR=$(KERN_DIR) $(if-expr $(KMK_OPTS_JOBS) > 1,JOBS=$(KMK_OPTS_JOBS),) -C $$(PATH_TARGET)/tst$(module)_mod \
    42634255                2>&1 | tee "$$(PATH_TARGET)/tst$(module)_mod/make.err"
    42644256        $(QUIET)! grep "^WARNING: .* undefined!$$$$" "$$(PATH_TARGET)/tst$(module)_mod/make.err"
     
    46974689  TEMPLATE_VBOXR3EXE_CXXFLAGS         += $(VBOX_GCC_WERR)
    46984690 endif
    4699  ifdef VBOX_WITH_OLD_GLIBC_SUPPORT
    4700   # Use older versions of APIs which were improved in versions of glibc later
    4701   # than what we are targetting, and do not use the stack protector, which
    4702   # needs glibc 2.4 or later.
    4703   TEMPLATE_VBOXR3EXE_CXXFLAGS.linux    = \
    4704         -include $(PATH_ROOT)/include/iprt/linux/symvers.h \
    4705         $(VBOX_GCC_fno-stack-protector)
    4706   TEMPLATE_VBOXR3EXE_CFLAGS.linux      = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.linux)
    4707  endif
    47084691TEMPLATE_VBOXR3EXE_CXXFLAGS.x86        = -m32
    47094692TEMPLATE_VBOXR3EXE_CXXFLAGS.amd64      = -m64
     
    47374720TEMPLATE_VBOXR3EXE_LDFLAGS.sparc64     = -m64
    47384721TEMPLATE_VBOXR3EXE_LDFLAGS.linux       = -Wl,-z,noexecstack,-z,relro $(VBOX_LD_as_needed)
    4739  ifdef VBOX_WITH_OLD_GLIBC_SUPPORT
    4740   # The GNU_HASH ELF tag is not supported by older systems.
    4741 TEMPLATE_VBOXR3EXE_LDFLAGS.linux      += -Wl,--hash-style=sysv
    4742  endif
    47434722TEMPLATE_VBOXR3EXE_LDFLAGS.solaris     = -Wl,-z,ignore # same as VBOX_LD_as_needed
    47444723TEMPLATE_VBOXR3EXE_LDFLAGS.debug       = $(VBOX_GCC_SANITIZER_FLAGS)
     
    65116490endif
    65126491
     6492# Use older versions of APIs which were improved in versions of glibc later
     6493# than what we are targetting, and do not use the stack protector, which
     6494# needs glibc 2.4 or later.
     6495TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS.linux    = \
     6496        -include $(PATH_ROOT)/include/iprt/linux/symvers.h \
     6497        $(VBOX_GCC_fno-stack-protector)
     6498TEMPLATE_VBOXGUESTR3EXE_CFLAGS.linux      = $(TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS.linux)
     6499# The GNU_HASH ELF tag is not supported by older systems.
     6500TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.linux      += -Wl,--hash-style=sysv
     6501
    65136502#
    65146503# Template for building normal R3 programs for the guest additions.
     
    67126701TEMPLATE_VBOXGUESTR3XF86MOD_LIBS.$(KBUILD_TARGET)    = $(NO_SUCH_VARIABLE)
    67136702TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.$(KBUILD_TARGET) = $(NO_SUCH_VARIABLE)
    6714 ifdef VBOX_WITH_OLD_GLIBC_SUPPORT
    67156703# The GNU_HASH ELF tag is not supported by older systems.
    67166704TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.linux = --hash-style=sysv
    6717 endif
    67186705TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.$(KBUILD_TYPE)   = $(NO_SUCH_VARIABLE)
    67196706TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS          = -r
  • trunk/src/VBox/Additions/x11/VBoxClient/Makefile.kmk

    r70936 r71694  
    6868        supc++ \
    6969        gcc_eh
    70 ifdef VBOX_WITH_OLD_GLIBC_SUPPORT
    71  # This has to be in LIBS, so as to be linked in after supc++ and gcc_eh, which
    72  # depend on the symbols it provides.  Static supc++ and gcc_eh on at least
    73  # Ubuntu 17.04 contain references to __sprintf_chk and __stack_chk_fail.
    74  # Furthermore, they contain references to memcpy, which needs to be resolved
    75  # to memcpy@GLIBC_2.2.5, which we solve in a not-very-satisfactory way with a
    76  # wrapper.
    77  ifeq ($(KBUILD_TARGET),linux)
     70
     71# The following is for ensuring binary compatibility for old Linux guests.
     72# This has to be in LIBS, so as to be linked in after supc++ and gcc_eh, which
     73# depend on the symbols it provides.  Static supc++ and gcc_eh on at least
     74# Ubuntu 17.04 contain references to __sprintf_chk and __stack_chk_fail.
     75# Furthermore, they contain references to memcpy, which needs to be resolved
     76# to memcpy@GLIBC_2.2.5, which we solve in a not-very-satisfactory way with a
     77# wrapper.
     78ifeq ($(KBUILD_TARGET),linux)
    7879VBoxClient_LIBS    += \
    7980        $(PATH_ROOT)/src/VBox/Additions/x11/VBoxClient/chk_stubs.c
    8081VBoxClient_LDFLAGS.amd64 += \
    8182        -Wl,--wrap=memcpy
    82  endif
    8383endif
    8484
Note: See TracChangeset for help on using the changeset viewer.

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