Page MenuHomeFreeBSD

remove clang headers conflicting with FreeBSD headers
ClosedPublic

Authored by alfredo on Jan 17 2019, 7:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 28 2024, 10:24 AM
Unknown Object (File)
Dec 22 2023, 11:07 PM
Unknown Object (File)
Nov 10 2023, 5:30 PM
Unknown Object (File)
Nov 9 2023, 10:00 PM
Unknown Object (File)
Oct 9 2023, 4:30 PM
Unknown Object (File)
Oct 6 2023, 8:57 PM
Unknown Object (File)
Aug 28 2023, 11:32 AM
Unknown Object (File)
Jul 8 2023, 7:40 AM

Details

Summary

Some clang headers are conflicting with FreeBSD headers. There was a previous patch that removed them from package install, but it was reverted on revision r459483 as it was believe that now works properly.
I identified that conflict still exists, during my tests cross compiling from x86_64 to powerpc64 host using llvm-devel package.

This change reintegrates the previous patch and include more files, matching the ones that are removed from src BASE:

in /usr/src/lib/clang/headers/Makefile :

Headers which possibly conflict with our own versions:
.if defined(INSTALL_CONFLICTING_CLANG_HEADERS)
INCS+=          float.h
INCS+=          intrin.h
INCS+=          inttypes.h
INCS+=          iso646.h
INCS+=          limits.h
INCS+=          stdalign.h
INCS+=          stdarg.h
INCS+=          stdatomic.h
INCS+=          stdbool.h
INCS+=          stddef.h
INCS+=          stdint.h
INCS+=          stdnoreturn.h
INCS+=          tgmath.h
INCS+=          unwind.h
INCS+=          varargs.h
.endif
Test Plan

build clang (from /usr/ports/devel/llvm-devel)
build src base using clang-devel (CC=clang-devel, CXX=clang++-devel and so)

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

alfredo edited the test plan for this revision. (Show Details)
alfredo edited the summary of this revision. (Show Details)

Error output example:

/usr/local/bin/clang-devel -target powerpc64-unknown-freebsd13.0 --sysroot=/usr/obj/usr/src/powerpc.powerpc64/tmp -B/usr/obj/usr/src/powerpc.powerpc64/tmp/usr/bin  -O2 -pipe   -DNO__SCCSID -DNO__RCSID -I/usr/src/lib/libc/include -I/usr/src/include -I/usr/src/lib/libc/powerpc64 -DNLS  -D__DBINTERFACE_PRIVATE -I/usr/src/contrib/gdtoa -I/usr/src/contrib/libc-vis -DINET6 -I/usr/obj/usr/src/powerpc.powerpc64/lib/libc -I/usr/src/lib/libc/resolv -D_ACL_PRIVATE -DPOSIX_MISTAKE -I/usr/src/lib/libmd -I/usr/src/contrib/jemalloc/include -I/usr/src/contrib/tzcode/stdtime -I/usr/src/lib/libc/stdtime -I/usr/src/lib/libc/locale -DBROKEN_DES -DPORTMAP -DDES_BUILTIN -I/usr/src/lib/libc/rpc -DYP -DNS_CACHING -DSYMBOL_VERSIONING -g -MD  -MF.depend.getgrent.o -MTgetgrent.o -std=gnu99 -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -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-unused-local-typedef -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter  -Qunused-arguments  -I/usr/src/lib/libutil -I/usr/src/lib/msun/powerpc -I/usr/src/lib/msun/src -c /usr/src/lib/libc/gen/getgrent.c -o getgrent.o
In file included from /usr/src/lib/libc/gen/getgrent.c:55:
/usr/src/include/stdio.h:77:19: error: redefinition of typedef 'va_list' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef __va_list       va_list;
                        ^
/usr/local/llvm-devel/lib/clang/8.0.0/include/stdarg.h:30:27: note: previous definition is here
typedef __builtin_va_list va_list;
                          ^
1 error generated.
*** [getgrent.o] Error code 1

make[4]: stopped in /usr/src/lib/libc
1 error

What version of FreeBSD is your system running? I'm happy to commit this, but want to make sure I understand the issue fully.

What version of FreeBSD is your system running? I'm happy to commit this, but want to make sure I understand the issue fully.

I'm using two systems in my tests:
1 - x84_64 machine cross compiling base to powerpc64-elfv2 running: FreeBSD 12.0-RC3 FreeBSD 12.0-RC3 r341271 GENERIC amd64
2 - powerpc64 machine "cross" compiling base to powerpv64-elfv2 running: FreeBSD 12.0-RELEASE r341666 GENERIC

the conflicts are between libraries at /usr/obj/usr/src/powerpc.powerpc64/tmp/usr/include/ and the ones instaled by llvm-devel ports at /usr/local/llvm-devel/lib/clang/8.0.0/include/

This revision is now accepted and ready to land.Jan 19 2019, 12:02 AM
This revision was automatically updated to reflect the committed changes.