Summary: | sys-devel/clang installs headers that conflict with system headers on Gentoo FreeBSD | ||
---|---|---|---|
Product: | Gentoo/Alt | Reporter: | Richard Yao (RETIRED) <ryao> |
Component: | FreeBSD | Assignee: | Bernard Cafarelli <voyageur> |
Status: | RESOLVED FIXED | ||
Severity: | normal | Keywords: | Bug |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | FreeBSD | ||
See Also: | http://llvm.org/bugs/show_bug.cgi?id=12957 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 408963 | ||
Attachments: | sys-freebsd/freebsd-ubin-9.0-r1 build failure |
Description
Richard Yao (RETIRED)
2012-05-22 20:46:34 UTC
Doing `rm /usr/lib/clang/3.0/include/{std,float,iso,limits,tgmath,varargs}*.h` makes this problem disappear. It seems that FreeBSD's build system does not install those headers. Also, FreeBSD's build system installs them in /usr/include/clang/3.0 instead of /usr/lib/clang/3.0/include. It might be a good idea to mimic both behaviors. FreeBSD has a Makefile responsible for installing these in /usr/src/lib/clang/include/Makefile that contains: # $FreeBSD$ .PATH: ${.CURDIR}/../../../contrib/llvm/tools/clang/lib/Headers INCSDIR=${INCLUDEDIR}/clang/3.0 INCS= altivec.h \ avxintrin.h \ emmintrin.h \ immintrin.h \ mm3dnow.h \ mm_malloc.h \ mmintrin.h \ nmmintrin.h \ pmmintrin.h \ smmintrin.h \ tmmintrin.h \ wmmintrin.h \ x86intrin.h \ xmmintrin.h .include <bsd.init.mk> .include <bsd.incs.mk> .include <bsd.obj.mk> It appears that moving those files into /usr/include/clang/3.0 and removing the remainder works on Gentoo FreeBSD. Given that these are includes, it might make sense to use the /usr/include/clang/3.0 location for these on both FreeBSD and Linux. Headers in /lib should indeed be moved, though I'm pretty sure at least some include files went in the correct /usr/include/clang. So we have to fix the buildsystem to stop installing headers all around the system :) I have committed a fix for this in sys-devel/clang-3.0-r4. sys-devel/clang-3.1 is unaffected. I have left the header locations alone, but their locations are not of vital importance, so I consider this issue to be resolved. (In reply to comment #4) > I have committed a fix for this in sys-devel/clang-3.0-r4. > sys-devel/clang-3.1 is unaffected. > > I have left the header locations alone, but their locations are not of vital > importance, so I consider this issue to be resolved. Correction. sys-devel/clang-3.1 was affected to a lesser extent. This is now fixed in sys-devel/clang-3.1-r2. When using llvm-3.7.1, fails to build sys-freebsd/boot0-10.2. I opened PR to fix this problem on github. https://github.com/gentoo/gentoo/pull/817 clang -O2 -pipe -fno-strict-aliasing -ffreestanding -Wformat -fPIC -I/var/tmp/portage/sys-freebsd/boot0-10.2/work/sys/boot/userboot/libstand/../../../../lib/libstand -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -DBZ_NO_STDIO -DBZ_NO_COMPRESS -DHAVE_MEMCPY -I/var/tmp/portage/sys-freebsd/boot0-10.2/work/sys/boot/userboot/libstand/../../../../lib/libz -std=gnu99 -Qunused-arguments -fno-stack-protector -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -Wno-parentheses -c /var/tmp/portage/sys-freebsd/boot0-10.2/work/sys/boot/userboot/libstand/../../../../lib/libc/string/strcpy.c -o strcpy.o clang -O2 -pipe -fno-strict-aliasing -ffreestanding -Wformat -fPIC -I/var/tmp/portage/sys-freebsd/boot0-10.2/work/sys/boot/userboot/libstand/../../../../lib/libstand -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -DBZ_NO_STDIO -DBZ_NO_COMPRESS -DHAVE_MEMCPY -I/var/tmp/portage/sys-freebsd/boot0-10.2/work/sys/boot/userboot/libstand/../../../../lib/libz -std=gnu99 -Qunused-arguments -fno-stack-protector -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -Wno-parentheses -c /var/tmp/portage/sys-freebsd/boot0-10.2/work/sys/boot/userboot/libstand/../../../../lib/libc/string/strcspn.c -o strcspn.o /var/tmp/portage/sys-freebsd/boot0-10.2/work/sys/boot/userboot/libstand/../../../../lib/libc/string/strcspn.c:46:31: error: use of undeclared identifier 'LONG_BIT' u_long tbl[(UCHAR_MAX + 1) / LONG_BIT]; ^ /var/tmp/portage/sys-freebsd/boot0-10.2/work/sys/boot/userboot/libstand/../../../../lib/libc/string/strcspn.c:60:9: error: use of undeclared identifier 'LONG_BIT' idx = IDX(*charset); ^ /var/tmp/portage/sys-freebsd/boot0-10.2/work/sys/boot/userboot/libstand/../../../../lib/libc/string/strcspn.c:34:31: note: expanded from macro 'IDX' #define IDX(c) ((u_char)(c) / LONG_BIT) ^ /var/tmp/portage/sys-freebsd/boot0-10.2/work/sys/boot/userboot/libstand/../../../../lib/libc/string/strcspn.c:61:9: error: use of undeclared identifier 'LONG_BIT' bit = BIT(*charset); ^ /var/tmp/portage/sys-freebsd/boot0-10.2/work/sys/boot/userboot/libstand/../../../../lib/libc/string/strcspn.c:35:45: note: expanded from macro 'BIT' #define BIT(c) ((u_long)1 << ((u_char)(c) % LONG_BIT)) ^ /var/tmp/portage/sys-freebsd/boot0-10.2/work/sys/boot/userboot/libstand/../../../../lib/libc/string/strcspn.c:66:9: error: use of undeclared identifier 'LONG_BIT' idx = IDX(*s1); ^ /var/tmp/portage/sys-freebsd/boot0-10.2/work/sys/boot/userboot/libstand/../../../../lib/libc/string/strcspn.c:34:31: note: expanded from macro 'IDX' #define IDX(c) ((u_char)(c) / LONG_BIT) ^ /var/tmp/portage/sys-freebsd/boot0-10.2/work/sys/boot/userboot/libstand/../../../../lib/libc/string/strcspn.c:67:9: error: use of undeclared identifier 'LONG_BIT' bit = BIT(*s1); ^ /var/tmp/portage/sys-freebsd/boot0-10.2/work/sys/boot/userboot/libstand/../../../../lib/libc/string/strcspn.c:35:45: note: expanded from macro 'BIT' #define BIT(c) ((u_long)1 << ((u_char)(c) % LONG_BIT)) ^ 5 errors generated. *** [strcspn.o] Error code 1 make: stopped in /var/tmp/portage/sys-freebsd/boot0-10.2/work/sys/boot/userboot/libstand 1 error make: stopped in /var/tmp/portage/sys-freebsd/boot0-10.2/work/sys/boot/userboot/libstand * ERROR: sys-freebsd/boot0-10.2::gentoo failed (compile phase): * make failed * * Call stack: * ebuild.sh, line 133: Called src_compile * environment, line 2694: Called freebsd_src_compile * environment, line 1239: Called bsdmk_src_compile * environment, line 519: Called die * The specific snippet of code: * mkmake "$@" || die "make failed" * * If you need support, post the output of `emerge --info '=sys-freebsd/boot0-10.2::gentoo'`, * the complete build log and the output of `emerge -pqv '=sys-freebsd/boot0-10.2::gentoo'`. * The complete build log is located at '/var/tmp/portage/sys-freebsd/boot0-10.2/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/sys-freebsd/boot0-10.2/temp/environment'. * Working directory: '/var/tmp/portage/sys-freebsd/boot0-10.2/work/sys/boot/userboot/libstand' * S: '/var/tmp/portage/sys-freebsd/boot0-10.2/work/sys/boot' commit 396cde2 (HEAD, master) Merge: 43979f1 7e93332 Author: Patrice Clement <monsieurp@gentoo.org> Date: Mon Feb 8 21:19:56 2016 +0000 Merge remote-tracking branch 'github/pr/817'. Gentoo-Bug: 417171 Pull-Request: https://github.com/gentoo/gentoo/pull/817 |