https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221288

--- Comment #11 from Mark Millard <mar...@dsl-only.net> ---
Trying my standard-C++ program that uses C++ threads in a more
modern context (head -r322287, lang/gcc7) in an amd64 context
under a Virtual Box virtual machine (that is running on
Windows 10 Pro). . .

# g++7 -std=c++14 -Wpedantic -Wall -pthread -Wl,-rpath=/usr/local/lib/gcc7 -O2
cpp_clocks_investigation.cpp

# ldd a.out
a.out:
        libstdc++.so.6 => /usr/local/lib/gcc7/libstdc++.so.6 (0x800844000)
        libm.so.5 => /lib/libm.so.5 (0x800bd8000)
        libgcc_s.so.1 => /usr/local/lib/gcc7/libgcc_s.so.1 (0x800e05000)
        libthr.so.3 => /lib/libthr.so.3 (0x80101c000)
        libc.so.7 => /lib/libc.so.7 (0x801244000)

# ./a.out
. . . (omitted) . . .
Segmentation fault (core dumped)

# g++7 -std=c++14 -Wpedantic -Wall -pthread -O2 cpp_clocks_investigation.cpp#
ldd a.out
a.out:
        libstdc++.so.6 => /usr/local/lib/gcc7/libstdc++.so.6 (0x800844000)
        libm.so.5 => /lib/libm.so.5 (0x800bd8000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x800e05000)
        libthr.so.3 => /lib/libthr.so.3 (0x80101b000)
        libc.so.7 => /lib/libc.so.7 (0x801243000)

# ./a.out
. . . (omitted) . . .
End of clock tests.

So it worked for /lib/libgcc_s.so.1 but not for
/usr/local/lib/gcc7/libgcc_s.so.1
and I must have been wrong about /lib/libcxxrt.so.1 being what mattered.

This threading example is a context where -Wl,-rpath=/usr/local/lib/gcc7
prevents correct operation because of cross library dependencies on
implementation details of the build-time context vs. the mismatched
runtime context for libthr.so.3 vs. libgcc_s.so.1 .


# clang++ -std=c++14 -Wpedantic -Wall -pthread -O2 cpp_clocks_investigation.cpp

# ldd a.out
a.out:
        libc++.so.1 => /usr/lib/libc++.so.1 (0x800844000)
        libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x800b10000)
        libm.so.5 => /lib/libm.so.5 (0x800d2e000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x800f5b000)
        libthr.so.3 => /lib/libthr.so.3 (0x801171000)
        libc.so.7 => /lib/libc.so.7 (0x801399000)

# ./a.out
. . . (omitted) . . .
End of clock tests.

So this also worked. Again /lib/libthr.so.3 and /lib/libgcc_s.so.1
go together just fine.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"

Reply via email to