Closed jtojnar closed 6 years ago
What compiler is this?
Are you sure those are what's causing it? They're also in my build env and don't fail.
root@5314b8878ad4:/build/efi# make GNUEFIDIR=/usr/lib
gcc -Og -g3 -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -fpic -Werror -Wall -Wextra -fshort-wchar -fno-merge-constants -ffreestanding -fno-stack-protector -fno-stack-check --std=gnu11 -DCONFIG_x86_64 -I/usr/include/efi/ -I/usr/include/efi/x86_64/ -iquote/build/include "-DDEBUGDIR=L\"/\"" -mno-mmx -mno-sse -mno-red-zone -nostdinc -maccumulate-outgoing-args -DEFI_FUNCTION_WRAPPER -DGNU_EFI_USE_MS_ABI -I/usr/lib/gcc/x86_64-linux-gnu/7/include -c -o fakeesrt2.o fakeesrt2.c
gcc -nostdlib -Wl,--warn-common -Wl,--no-undefined -Wl,--fatal-warnings -Wl,-shared -Wl,-Bsymbolic -L/usr/lib64 -L/usr/lib -Wl,--build-id=sha1 -Wl,--hash-style=sysv /usr/lib/crt0-efi-x86_64.o -o fakeesrt2.so fakeesrt2.o -lefi -lgnuefi \
/usr/lib/gcc/x86_64-linux-gnu/7/libgcc.a \
-T elf_x86_64_efi.lds
objcopy -j .text -j .sdata -j .data -j .dynamic -j .dynsym \
-j .rel* -j .rela* -j .reloc -j .eh_frame \
--target efi-app-x86_64 fakeesrt2.so fakeesrt2.efi
rm fakeesrt2.o fakeesrt2.so
root@5314b8878ad4:/build/efi# gcc --version | head -1
gcc (Ubuntu 7.3.0-3ubuntu1) 7.3.0
We use gcc (GCC) 6.4.0
. And I think it is about order of arguments: In efi/Makefile
it is first turned on with -fstack-protector-strong
, then disabled using -fno-stack-protector
and finally re-enabled by Nix. I guess we should prevent enabling it for the efi
directory.
On NixOS, we use hardening by default and unless we disable
-fstack-protector-strong --param ssp-buffer-size=4
, the build will fail with: