[cfe-dev] Clang generates segfaulting executables on Gentoo/FreeBSD (FreeBSD with Portage and more)

Johnson Steward via cfe-dev cfe-dev at lists.llvm.org
Mon Aug 28 07:43:37 PDT 2017


Hello everyone,

Greetings! I'm recently working on the Gentoo/FreeBSD project, trying to
upgrade the outdated (and in lack of maintainers) G-FBSD stages to the current
version. Bootstrapping GCC turned out to be a complete nightmare on such a
platform, so I chose clang. Everything seems to be going pretty well and I've
updated libcxx, llvm and clang to 3.9.1. Yet sometimes clang generates faulty
C executables which segfaults such as pkg-config and thre intermediate
"make_hash" utility generated while compiling ncurses.

I'm pretty new to dealing with toolchains, and if I made any stupid mistakes
don't hesitate to point them out. The following links hold the base64'ed
executable "make_hash" from ncurses and its core dump. The compile commandline
is as follows.

compile commandline:

clang -o make_hash -DHAVE_CONFIG_H -DUSE_BUILD_CC -I../ncurses -I/var/
tmp/portage/sys-libs/ncurses-6.0-r1/work/ncurses-6.0/ncurses -I../include -I/
var/tmp/portage/sys-libs/ncurses-6.0-r1/work/ncurses-6.0/ncurses/../include
-D_GNU_SOURCE -O1 -pipe /var/tmp/portage/sys-libs/ncurses-6.0-r1/work/
ncurses-6.0/ncurses/tinfo/make_hash.c

make_hash: (get it with curl ${URL} | base64 -d | bzip2 -d > make_hash)

URL=https://paste.pound-python.org/raw/laRZK3NxtxAtL7aUXSbY/

make_hash.core: (same as above)

URL=https://paste.pound-python.org/raw/RHvAMBnj0yJMm4fxPxBW/

make_hash.c: (plain text)

URL=https://paste.pound-python.org/raw/Fxot8FaEgVDfwMBRw34c/

If more information is needed don't hesitate to ask for them in the following-
up mails. Any form of opinions are welcomed.

Thanks in advance!

Yours,
KireinaHoro



More information about the cfe-dev mailing list