We've been building a large open source on a variety of platforms (Linux, Windows, Mac OS X, 32-bit and 64-bit) for several years without troubles. Lately however, the Mac OS X build (64-bit) stopped working correctly and started to crash randomly. It more or less coincided with an update of Mac OS X on our build machine from 10.7 to 10.8.2 (but the compiler toolchain didn't change, it's still llvm-gcc 4.2.1). Our application is made of a couple of dynamic (shared) libraries and many executables using them. One of the shared library overrides the new and delete operators for a variety of reasons. On Mac OS X (and Linux), all symbols are exported by default, including our overloaded new and delete operators. The crashes on Mac OS X seem related to some memory being allocated with one memory subsystem (not ours) then freed through our own (and incompatible) delete implementation. May 16, 2017 Comparably to building a static lib, the shared library file is saved in 'lib' (relative to the NVIDIA CUDA SDK folder) - release and debug builds. @TBIGNON Ok so I did a little research and found this is a problem with Qt5.7 and the newest clang from apple. I would file a bug with Qt giving your version of clang. An easy fix is to use Qt 5.6 on OSX for now as it doesn't have this issue. The sanest solution seems to be preventing the overloaded operators from being visible to the users of the shared library. This can be accomplished in two ways: marking the operators with __attribute__((visibility('hidden'))), or using the -unexported_symbols_list linker command line option to prevent some symbols from being exported. The first solution unfortunately doesn't work: gcc emits warnings saying that the operators have been declared differently (in ) and thus the attributes will be ignored. From my readings in various places, the second solution seems to be the right one to this problem. However for some reason we can't make it work. When linking the shared library, we're passing the -Wl,-unexported_symbols_list unexported_symbols_list.txt option to g++, which in turns should be passed to ld. The unexported_symbols_list.txt file contains the following list of symbols: __ZdaPv __ZdaPvRKSt9nothrow_t __ZdlPv __ZdlPvRKSt9nothrow_t __ZdlPvS_ __Znam __ZnamRKSt9nothrow_t __Znwm __ZnwmPv __ZnwmRKSt9nothrow_t These are all the variations of new and delete that we override and want to be hidden. Realtech rtl8029 or rtl8029sa drivers for mac Os 8.6-9.2 needed. Discussion in 'Hardware' started by B'ichela, Jun 9, 2007. B'ichela Guest. Does anyone know if there is such a driver for Mac Os 8.6 to 9.2.2? I have several of these PcI ne2000 compatible beasties that I would like. Looking for drivers for rtl8029 cards. Rtl8029 driver for mac. We found these symbols by doing nm libappleseed.dylib then unmangling the symbol names using c++filt. Here's the command line generated by CMake to link libappeseed.dylib: /usr/bin/g++ -g -Werror -dynamiclib -Wl,-headerpad_max_install_names -framework Cocoa -lcurl -Werror -Wl,-unexported_symbols_list -Wl,unexported_symbols_list.txt -o./mac-gcc4/appleseed/libappleseed.dylib [.] Unfortunately, despite all our efforts it appears that the symbols remain (as nm shows). Any idea what we are doing wrong? Is there another approach that we could try? 19, 2012: Our problem and the supposed solution are well covered in this technical note from Apple: (section 'Overriding new/delete'). Pointers to relevant source code: • operator new and operator delete overrides: • Macros to control symbol visibility in the shared library: Fragment of nm's output after building libappleseed.dylib with -fvisibility=hidden and running strip -x libappleseed.dylib. 2a41b0 T __ZdaPv 2a41f0 T __ZdaPvRKSt9nothrow_t 2a4190 T __ZdlPv 2a41d0 T __ZdlPvRKSt9nothrow_t 2a4060 T __Znam 2a4130 T __ZnamRKSt9nothrow_t 2a3ff0 T __Znwm 2a40d0 T __ZnwmRKSt9nothrow_t. This is something we'd like to do eventually. I was under the impression that gcc's visibility syntax was incompatible with Visual C++'s one (i.e. Visibility attributes were used in different places in declarations) but it appears from this document that I was wrong (or the situation improved since last time I checked). Thanks for pointing this out, we'll probably go this route eventually. That's a rather important change to apply and test though, so we'd still be interested in a quick interim solution. – Dec 10 '12 at 10:16 •. So we tried using -unexported_symbol symbol (by passing e.g. Laptop sleeve case 15 inch fabric waterproof protective cases for women. -Wl,-unexported_symbol -Wl,__ZdaPv to g++) but to no avail. The arguments are properly passed down to ld, but nm shows that the symbols remain in the generated library file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |