efivar-37-ia64-relro.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. https://github.com/rhboot/efivar/pull/164
  2. https://bugs.gentoo.org/749963
  3. From: Sergei Trofimovich <slyfox@gentoo.org>
  4. Date: Mon, 19 Oct 2020 19:05:01 +0100
  5. Subject: [PATCH] gcc.specs: drop --fatal-warnings from linker options (ia64
  6. compatibility)
  7. ```
  8. $ LANG=C make HOSTCC=x86_64-pc-linux-gnu-gcc CC=ia64-unknown-linux-gnu-gcc HOST_ARCH=ia64
  9. ia64-unknown-linux-gnu-gcc ... \
  10. -o libefivar.so ...
  11. /usr/libexec/gcc/ia64-unknown-linux-gnu/ld: warning: -z relro ignored
  12. collect2: error: ld returned 1 exit status
  13. make[1]: *** [/home/slyfox/dev/git/efivar/src/include/rules.mk:32: libefivar.so] Error 1
  14. ```
  15. ia64 (and a few others) binutils target does not support '-z relro' and always
  16. issues a warning. --fatal-warnings spec option turns the build into always failing one.
  17. The change drops `--fatal-warnings` options from gcc.spec entirely.
  18. Reported-by: Émeric Maschino
  19. Bug: https://bugs.gentoo.org/749963
  20. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
  21. --- a/gcc.specs
  22. +++ b/gcc.specs
  23. @@ -11,7 +11,7 @@
  24. + %(efivar_cpp_options) -Wmaybe-uninitialized -fno-merge-constants -fvisibility=hidden %{!r:%{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIE}}}}}}
  25. *self_spec:
  26. -+ %{!shared:%{!static:%{!r:-pie}}} %{static:-Wl,-no-fatal-warnings -Wl,-static -static -Wl,-z,relro,-z,now}
  27. ++ %{!shared:%{!static:%{!r:-pie}}} %{static:-Wl,-static -static -Wl,-z,relro,-z,now}
  28. *link:
  29. -+ %{!static:--fatal-warnings} --no-undefined-version --no-allow-shlib-undefined --add-needed -z now --build-id %{!static:%{!shared:-pie}} %{shared:-z relro} %{static:%<pie}
  30. ++ --no-undefined-version --no-allow-shlib-undefined --add-needed -z now --build-id %{!static:%{!shared:-pie}} %{shared:-z relro} %{static:%<pie}