CTSRD-CHERI / cheribsd-ports

FreeBSD ports tree adapted for CheriBSD.
https://CheriBSD.org
Other
5 stars 11 forks source link

devel/llvm-{cheri,morello}: std*.h files should not be installed with LLVM #71

Closed kwitaszczyk closed 1 year ago

kwitaszczyk commented 1 year ago

std.h files shipped with LLVM are included instead of files from /usr/include when compiling. Other LLVM packages (e.g., llvm13) from FreeBSD aren't shipped with std.h files.

This can result in various bugs, e.g. missing __BEGIN_DECLS from <sys/cdefs.h> that is included by <stddef.h> but not by stddef.h from llvm-morello:

/bin/sh ../../libtool  --tag=CC   --mode=compile /toolchain/bin/clang -DHAVE_CONFIG_H -I. -I../..  -I../..   -pthread -I../../lib/include -Wall -Wpointer-arith -D_GNU_SOURCE -I../../contrib/freebsd/include -I/usr/local64/include -DLIBICONV_PLUG -isystem /usr/local64/include  -pipe -mabi=aapcs  -DLIBICONV_PLUG -g -fstack-protector-strong -isystem /usr/local64/include -fno-strict-aliasing  -MT libdvbv5_la-dvb-dev-remote.lo -MD -MP -MF .deps/libdvbv5_la-dvb-dev-remote.Tpo -c -o libdvbv5_la-dvb-dev-remote.lo `test -f 'dvb-dev-remote.c' || echo './'`dvb-dev-remote.c
libtool: compile:  /toolchain/bin/clang -DHAVE_CONFIG_H -I. -I../.. -I../.. -pthread -I../../lib/include -Wall -Wpointer-arith -D_GNU_SOURCE -I../../contrib/freebsd/include -I/usr/local64/include -DLIBICONV_PLUG -isystem /usr/local64/include -pipe -mabi=aapcs -DLIBICONV_PLUG -g -fstack-protector-strong -isystem /usr/local64/include -fno-strict-aliasing -MT libdvbv5_la-dvb-dev-remote.lo -MD -MP -MF .deps/libdvbv5_la-dvb-dev-remote.Tpo -c dvb-dev-remote.c  -fPIC -DPIC -o .libs/libdvbv5_la-dvb-dev-remote.o
In file included from dvb-dev-remote.c:27:
/usr/include/execinfo.h:37:1: error: unknown type name '__BEGIN_DECLS'
__BEGIN_DECLS
^
/usr/include/execinfo.h:38:7: error: expected ';' after top level declarator
size_t backtrace(void **, size_t);
      ^
/usr/include/execinfo.h:43:1: error: unknown type name '__END_DECLS'
__END_DECLS
^
brooksdavis commented 1 year ago

I've removed those headers those in freebsd/freebsd-ports@bae4ebdcf9c2a12d71a656cd474f2a9ff7c108ba