Bug 229246 - -Wl,--unresolved-symbols=ignore-in-object-files fails for shared libraries
Summary: -Wl,--unresolved-symbols=ignore-in-object-files fails for shared libraries
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 11.1-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-23 06:36 UTC by Yuri Victorovich
Modified: 2018-06-23 06:36 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer 2018-06-23 06:36:50 UTC
This command line:
> c++ -Wl,--unresolved-symbols=ignore-in-object-files -shared -o libblank.so blank.cpp
fails:
> /usr/lib/libcxxrt.so: undefined reference to `_Unwind_GetDataRelBase@GCC_3.0'
> /usr/lib/libcxxrt.so: undefined reference to `_Unwind_SetIP@GCC_3.0'
> /usr/lib/libcxxrt.so: undefined reference to `_Unwind_GetIP@GCC_3.0'
> /lib/libc.so.7: undefined reference to `__progname'
> /usr/lib/libcxxrt.so: undefined reference to `_Unwind_RaiseException@GCC_3.0'
> /usr/lib/libcxxrt.so: undefined reference to `_Unwind_GetLanguageSpecificData@GCC_3.0'
> /usr/lib/libcxxrt.so: undefined reference to `_Unwind_GetRegionStart@GCC_3.0'
> /usr/lib/libcxxrt.so: undefined reference to `_Unwind_SetGR@GCC_3.0'
> /usr/lib/libc++.so.1: undefined reference to `_Unwind_Resume@GCC_3.0'
> /usr/lib/libcxxrt.so: undefined reference to `_Unwind_Backtrace@GCC_3.3'
> /usr/lib/libcxxrt.so: undefined reference to `_Unwind_Resume_or_Rethrow@GCC_3.3'
> /lib/libc.so.7: undefined reference to `environ'
> /usr/lib/libcxxrt.so: undefined reference to `_Unwind_GetTextRelBase@GCC_3.0'
> clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation)

There are no object files that user supplied, so -Wl,--unresolved-symbols=ignore-in-object-files should be practically a noop?

I found this error in one of the projects, and it seems like a bug in the compiler to me. It should link whatever it links normally without this flag.