Changeset 72137 in vbox for trunk/src/VBox
- Timestamp:
- May 7, 2018 12:31:41 PM (7 years ago)
- Location:
- trunk/src/VBox/Additions/x11/VBoxClient
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/VBoxClient/Makefile.kmk
r72124 r72137 39 39 display-svga.cpp \ 40 40 display-svga-x11.cpp 41 VBoxClient_SOURCES.linux = \ 42 chk_stubs.c 41 43 VBoxClient_LIBPATH = \ 42 44 $(VBOX_LIBPATH32_X11) … … 68 70 supc++ \ 69 71 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. 90 76 ifeq ($(KBUILD_TARGET),linux) 91 VBoxClient_LIBS += \92 $(PATH_ROOT)/src/VBox/Additions/x11/VBoxClient/chk_stubs.c93 77 VBoxClient_LDFLAGS.amd64 += \ 94 78 -Wl,--wrap=memcpy -
trunk/src/VBox/Additions/x11/VBoxClient/chk_stubs.c
r72122 r72137 50 50 * supc++ and gcc_eh contain references which we cannot change. */ 51 51 52 #ifdef __cplusplus 53 extern "C" void *__wrap_memcpy(void *dest, const void *src, size_t n); 54 #endif 52 extern void *__wrap_memcpy(void *dest, const void *src, size_t n); 55 53 56 54 asm (".symver memcpy, memcpy@GLIBC_2.2.5");
Note:
See TracChangeset
for help on using the changeset viewer.