boostorg / boostorg/program_options
symbol visibility problem on macOS
- Lingua principale
- C++
- Stelle
- 136
- Fork
- 117
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
When I compile with gcc-9, gcc-10, clang-9, clang-10 or the Xcode clang I have this problem. I do not see it under Linux (Ubuntu 18 LTS):
[BUG-REPORT.txt](https://github.com/boostorg/program_options/files/4944925/BUG-REPORT.txt)
I get linkage warnings that suggest possible runtime failure
ld: warning: direct access in function '__ZN5boost10wrapexceptINS_15program_options14unknown_optionEEC1ERKS3_' from file lib/libboost_program_options.a(options_description.o)' to global weak symbol '__ZTVN5boost15program_options5errorE' from file XXX means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
What's weird is that visibility should only apply to dynamic linkage, and I have built the libraries entirely statically.
I was able to get around this by building all of boost by supplying `cxxflags="-fvisibility=default"` to b2. Probably not the right fix but make the problem go away.
Probably incomplete list of symbols causing this problem. I do not have this issue with any other Boost library I use.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Inizia con BUG-REPORT.txt e riproduci la build statica su macOS usando le versioni di GCC, Clang o Xcode Clang elencate. Confronta la build con e senza b2's cxxflags="-fvisibility=default" e controlla gli avvisi del linker relativi ai simboli di program_options. Il lavoro è completo quando gli avvisi di visibilità sono risolti senza fare affidamento su questo workaround.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cpp
- Ambito
- build-system, compilers
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 35/100