Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[defect]: jlibtool option --config has conflict with clang's #5442

Open
yanyir opened this issue Sep 26, 2024 · 0 comments · May be fixed by #5443
Open

[defect]: jlibtool option --config has conflict with clang's #5442

yanyir opened this issue Sep 26, 2024 · 0 comments · May be fixed by #5443
Labels
defect category: a defect or misbehaviour

Comments

@yanyir
Copy link

yanyir commented Sep 26, 2024

What type of defect/bug is this?

Unexpected behaviour (obvious or verified by project member)

How can the issue be reproduced?

I’ve encountered an issue while building FreeRADIUS using Clang. My CFLAGS includes the option --config /usr/lib/rpm/generic-hardened-clang.cfg. The build repeatedly fails due to missing .d and .lo files, with errors like the following:

mkdir -p build/objs/src/lib/
echo CC src/lib/cbuff.c
CC src/lib/cbuff.c
build/make/jlibtool --silent --mode=compile clang -o build/objs/src/lib/cbuff.lo -c -MD -I. -Isrc -include src/freeradius-devel/autoconf.h -include src/freeradius-devel/build.h -include src/freeradius-devel/features.h -include src/freeradius-devel/radpaths.h -fno-strict-aliasing -Wno-date-time -O2 -g -grecord-gcc-switches -pipe -fstack-protector-strong -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS --config /usr/lib/rpm/generic-hardened-clang.cfg -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fsigned-char -Wall -std=c99 -D_GNU_SOURCE -Wno-unknown-warning-option -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DOPENSSL_NO_KRB5 -DNDEBUG -D_LIBRADIUS -I/home/abuild/rpmbuild/BUILD/freeradius-server-3.2.3/src src/lib/cbuff.c
mkdir -p build/make/src/src/lib/
mkdir -p build/objs/src/lib/
sed  -e 's/#.*//' -e 's,^/home/abuild/rpmbuild/BUILD/freeradius-server-3.2.3,${top_srcdir},' -e 's, /home/abuild/rpmbuild/BUILD/freeradius-server-3.2.3, ${top_srcdir},' -e 's,^build,${BUILD_DIR},' -e 's, build/make/include/[^ :]*,,' -e 's, build, ${BUILD_DIR},' -e 's, /[^: ]*,,g' -e 's,^ *[^:]* *: *$,,' -e '/: </ d' -e 's/\.o: /.${OBJ_EXT}: /' -e '/^ *\\$/ d' < build/objs/src/lib/cbuff.d | sed -e '$!N; /^\(.*\)\n\1$/!P; D' >  build/make/src/src/lib/cbuff.mk
sed -e 's/#.*//' -e 's, build/make/include/[^ :]*,,' -e 's, /[^: ]*,,g' -e 's,^ *[^:]* *: *$,,' -e '/: </ d' -e 's/^[^:]*: *//' -e 's/ *\\$//' -e 's/$/ :/' < build/objs/src/lib/cbuff.d | sed -e '$!N; /^\(.*\)\n\1$/!P; D' >> build/make/src/src/lib/cbuff.mk
/bin/sh: line 1: build/objs/src/lib/cbuff.d: No such file or directory
/bin/sh: line 1: build/objs/src/lib/cbuff.d: No such file or directory
...
...
build/make/jlibtool --silent --mode=link clang -o build/lib/libfreeradius-radius.la -rpath /usr/lib64/freeradius   -Wl,-z,relro   -Wl,-z,now     -Wl,-z,relro   -Wl,-z,now    build/objs/src/lib/cbuff.lo build/objs/src/lib/cursor.lo build/objs/src/lib/debug.lo build/objs/src/lib/dict.lo build/objs/src/lib/filters.lo build/objs/src/lib/hash.lo build/objs/src/lib/hmacmd5.lo build/objs/src/lib/hmacsha1.lo build/objs/src/lib/isaac.lo build/objs/src/lib/log.lo build/objs/src/lib/misc.lo build/objs/src/lib/missing.lo build/objs/src/lib/md4.lo build/objs/src/lib/md5.lo build/objs/src/lib/net.lo build/objs/src/lib/pair.lo build/objs/src/lib/pcap.lo build/objs/src/lib/print.lo build/objs/src/lib/radius.lo build/objs/src/lib/rbtree.lo build/objs/src/lib/regex.lo build/objs/src/lib/sha1.lo build/objs/src/lib/snprintf.lo build/objs/src/lib/strlcat.lo build/objs/src/lib/strlcpy.lo build/objs/src/lib/socket.lo build/objs/src/lib/token.lo build/objs/src/lib/udpfromto.lo build/objs/src/lib/value.lo build/objs/src/lib/fifo.lo build/objs/src/lib/packet.lo build/objs/src/lib/event.lo build/objs/src/lib/getaddrinfo.lo build/objs/src/lib/heap.lo build/objs/src/lib/tcp.lo build/objs/src/lib/base64.lo build/objs/src/lib/version.lo build/objs/src/lib/atomic_queue.lo build/objs/src/lib/talloc.lo  -lcrypto -lssl -ltalloc -latomic  -lpcre -lresolv -ldl -lpthread  -lreadline -lpcap 
Cannot find suitable object file for build/objs/src/lib/cbuff.lo
make: *** [scripts/boiler.mk:638: build/lib/libfreeradius-radius.la] Error 1

(Note: Although I'm building freeradius-server-3.2.3, it seems the issue persists in the latest version.)

The --config flag is a recognized Clang command line argument (Clang 17.0.1 Command Line Reference) that specifies a configuration file. After some investigation, I found that removing --config /usr/lib/rpm/generic-hardened-clang.cfg from my CFLAGS allows the build to succeed.

The root cause seems to be a conflict with the --config option in script/jlibtool.c, which is used to show all configuration variables. Jlibtool mistakenly interprets my Clang --config <arg> and does not perform the intended compilation tasks. If I rename --config in jlibtool.c to something else, such as --print-config, would resolve the issue.

Log output from the FreeRADIUS daemon

Not applicable

Relevant log output from client utilities

No response

Backtrace from LLDB or GDB

No response

@yanyir yanyir added the defect category: a defect or misbehaviour label Sep 26, 2024
@yanyir yanyir linked a pull request Sep 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect category: a defect or misbehaviour
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant