Bug 221367 - i386 sanitizer runtimes not installed during amd64 32-bit compat in make installworld
Summary: i386 sanitizer runtimes not installed during amd64 32-bit compat in make inst...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-toolchain (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-09 13:51 UTC by Ed Maste
Modified: 2021-08-23 16:31 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer freebsd_triage 2017-08-09 13:51:46 UTC
The 32-bit compat lib install is executed with MK_TOOLCHAIN=no as of r264930 https://reviews.freebsd.org/rS264930 which prevents the sanitizer runtimes from being installed.
Comment 1 Ed Maste freebsd_committer freebsd_triage 2017-08-09 13:57:24 UTC
It seems just removing MK_TOOLCHAIN=no from Makefile.libcompat causes these additional files to be installed:

===> libc (install)
...
install  -o root -g wheel -m 444   libc_pic.a /usr/lib32/
...
===> libclang_rt (install)
===> libclang_rt/include (install)
install  -C -o root -g wheel -m 444  /usr/home/emaste/src/freebsd-wip/contrib/compiler-rt/include/sanitizer/allocator_interface.h /usr/home/emaste/src/freebsd-wip/contrib/compiler-rt/include/sanitizer/asan_interface.h /usr/home/emaste/src/freebsd-wip/contrib/compiler-rt/include/sanitizer/common_interface_defs.h /usr/home/emaste/src/freebsd-wip/contrib/compiler-rt/include/sanitizer/coverage_interface.h /usr/home/emaste/src/freebsd-wip/contrib/compiler-rt/include/sanitizer/dfsan_interface.h /usr/home/emaste/src/freebsd-wip/contrib/compiler-rt/include/sanitizer/esan_interface.h /usr/home/emaste/src/freebsd-wip/contrib/compiler-rt/include/sanitizer/linux_syscall_hooks.h /usr/home/emaste/src/freebsd-wip/contrib/compiler-rt/include/sanitizer/lsan_interface.h /usr/home/emaste/src/freebsd-wip/contrib/compiler-rt/include/sanitizer/msan_interface.h /usr/home/emaste/src/freebsd-wip/contrib/compiler-rt/include/sanitizer/tsan_interface.h /usr/home/emaste/src/freebsd-wip/contrib/compiler-rt/include/sanitizer/tsan_interface_atomic.h /usr/lib/clang/5.0.0/include/sanitizer/
===> libclang_rt/asan (install)
install  -C -o root -g wheel -m 444   libclang_rt.asan-i386.a /usr/lib/clang/5.0.0/lib/freebsd/
===> libclang_rt/asan-preinit (install)
install  -C -o root -g wheel -m 444   libclang_rt.asan-preinit-i386.a /usr/lib/clang/5.0.0/lib/freebsd/
===> libclang_rt/asan_dynamic (install)
install  -s -o root -g wheel -m 444     libclang_rt.asan-i386.so /usr/lib32/
install  -o root -g wheel -m 444    libclang_rt.asan-i386.so.debug /usr/lib/debug/usr/lib32/
===> libclang_rt/asan_cxx (install)
install  -C -o root -g wheel -m 444   libclang_rt.asan_cxx-i386.a /usr/lib/clang/5.0.0/lib/freebsd/
===> libclang_rt/safestack (install)
install  -C -o root -g wheel -m 444   libclang_rt.safestack-i386.a /usr/lib/clang/5.0.0/lib/freebsd/
===> libclang_rt/stats (install)
install  -C -o root -g wheel -m 444   libclang_rt.stats-i386.a /usr/lib/clang/5.0.0/lib/freebsd/
===> libclang_rt/stats_client (install)
install  -C -o root -g wheel -m 444   libclang_rt.stats_client-i386.a /usr/lib/clang/5.0.0/lib/freebsd/
===> libclang_rt/ubsan_standalone (install)
install  -C -o root -g wheel -m 444   libclang_rt.ubsan_standalone-i386.a /usr/lib/clang/5.0.0/lib/freebsd/
===> libclang_rt/ubsan_standalone_cxx (install)
install  -C -o root -g wheel -m 444   libclang_rt.ubsan_standalone_cxx-i386.a /usr/lib/clang/5.0.0/lib/freebsd/
===> libclang_rt/profile (install)
install  -C -o root -g wheel -m 444   libclang_rt.profile-i386.a /usr/lib/clang/5.0.0/lib/freebsd/
===> libelftc (install)
===> libpe (install)
Comment 2 Dimitry Andric freebsd_committer freebsd_triage 2017-08-13 20:22:36 UTC
(In reply to Ed Maste from comment #1)
> It seems just removing MK_TOOLCHAIN=no from Makefile.libcompat causes these
> additional files to be installed:
> 
> ===> libc (install)
> ...
> install  -o root -g wheel -m 444   libc_pic.a /usr/lib32/
> ...
> ===> libclang_rt (install)

Okay, but won't that also cause 32-bit versions of libllvm, libclang and clang itself to be built?  We definitely don't want that. :)
Comment 3 Ed Maste freebsd_committer freebsd_triage 2017-08-16 00:42:11 UTC
> Okay, but won't that also cause 32-bit versions of libllvm, libclang and clang
> itself to be built?  We definitely don't want that. :)

Good point - I compared the result of 'make installworld' between stock FreeBSD and with MK_TOOLCHAIN=no removed, but I did not notice if it caused libllvm, libclang to be built. Clang itself wouldn't be built, because the compat32 stage does nothing with bin/usr.bin etc.

The sanitizer runtimes are a bit of an interesting case. It seems they do belong with MK_TOOLCHAIN, they really are a runtime component tied to the Clang version in use.

Maybe we should not try to be too generic / "clean" here and just pass in a COMPAT32 flag to the submakes, and have the individual Makefiles do the right thing (skipping headers and all not-runtime-support libs)?
Comment 4 Pokemon999 2019-06-17 07:18:17 UTC
MARKED AS SPAM
Comment 5 Ed Maste freebsd_committer freebsd_triage 2021-08-23 16:31:59 UTC
or set e.g. MK_TOOLCHAIN_RUNTIMES based on WITH_/WITHOUT_TOOLCHAIN that isn't overridden in LIB32IMAKE?