-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Closed as not planned
Closed as not planned
Copy link
Labels
llvm:optimizationsquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Description
i'm compiling a static linux binary that talks directly to the kernel, i.e. without libc:
clang -O3 -nostdlib -nostartfiles -ffreestanding -fno-builtin-memset -Wl,-Bstatic -Qunused-arguments --target=x86_64-linux-gnu eval2.ll
if i delete the -O
then it works as expected.
i think some of the optimizations emits calls to memset
regardless of the command line arguments.
$ clang --version
clang version 20.1.7
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /gnu/store/hvi2iz7n4zk4pyxvibrxa6j43hkv4wn2-clang-20.1.7/bin
$ uname -a
Linux lelap 6.14.11 #1 SMP PREEMPT_DYNAMIC 1 x86_64 GNU/Linux
$ guix describe
Generation 231 Jul 06 2025 13:09:57 (current)
guix 50b7528
repository URL: https://codeberg.org/guix/guix.git
branch: master
commit: 50b75285883623ee244d0a71a225807c0672ac33
Metadata
Metadata
Assignees
Labels
llvm:optimizationsquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!