File tree Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -16,15 +16,15 @@ INCLUDE=include
1616# own device app* you just need to include tkey/debug.h and define
1717# either of them. You don't need to recompile tkey-libs.
1818
19- CFLAGS = -target riscv32-unknown-none-elf -march=rv32iczmmul -mabi=ilp32 \
19+ CFLAGS = $( EXTRA_CFLAGS ) -target riscv32-unknown-none-elf -march=rv32iczmmul -mabi=ilp32 \
2020 -mcmodel=medany -static -std=gnu99 -O2 -ffast-math -fno-common \
2121 -fno-builtin-printf -fno-builtin-putchar -nostdlib -mno-relax -flto \
2222 -Wall -Werror=implicit-function-declaration \
2323 -I $(INCLUDE ) -I .
2424
2525AS = clang
2626AR = llvm-ar
27- ASFLAGS = -target riscv32-unknown-none-elf -march=rv32iczmmul -mabi=ilp32 \
27+ ASFLAGS = $( EXTRA_ASFLAGS ) -target riscv32-unknown-none-elf -march=rv32iczmmul -mabi=ilp32 \
2828 -mcmodel=medany -mno-relax
2929
3030LDFLAGS =-T app.lds -L libcommon/ -lcommon -L libcrt0/ -lcrt0
Original file line number Diff line number Diff line change 1+ with import <nixpkgs> { } ;
2+ let
3+ # Use unwrapped clang to avoid hardening flags
4+ unwrappedClang = clang_multi . cc ;
5+ in
6+ mkShell {
7+ nativeBuildInputs = [
8+ gnumake
9+ unwrappedClang
10+ unwrappedClang . lib
11+ llvm
12+ lld
13+ go
14+ pre-commit
15+ ] ;
16+
17+ # Override CC/AS to use unwrapped clang (avoids Nix hardening wrapper)
18+ # Set resource directory for built-in headers (stddef.h, stdint.h, etc.)
19+ shellHook = ''
20+ export CC="${ unwrappedClang } /bin/clang"
21+ export AS="${ unwrappedClang } /bin/clang"
22+ export EXTRA_CFLAGS="-resource-dir ${ unwrappedClang . lib } /lib/clang/19"
23+ export EXTRA_ASFLAGS="-resource-dir ${ unwrappedClang . lib } /lib/clang/19"
24+ '' ;
25+ }
You can’t perform that action at this time.
0 commit comments