[gnutls-devel] GnuTLS | wrong text relocations on i386 due to non-PIC assembly (#818)
Development of GNU's TLS library
gnutls-devel at lists.gnutls.org
Wed Aug 14 16:14:48 CEST 2019
Andreas Metzler commented:
This would work. It uses GNU-make idioms, is this a problem?
```diff
diff --git a/cfg.mk b/cfg.mk
index ff79dbf2ed..dfa9857418 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -143,6 +143,8 @@ ASM_SOURCES_XXX := \
lib/accelerated/x86/XXX/aes-ssse3-x86.s \
lib/accelerated/x86/XXX/aes-ssse3-x86_64.s
+PL_NEEDS_FPIC := aesni-x86.s
+
ASM_SOURCES_ELF := $(subst XXX,elf,$(ASM_SOURCES_XXX))
ASM_SOURCES_COFF := $(subst XXX,coff,$(ASM_SOURCES_XXX))
ASM_SOURCES_MACOSX := $(subst XXX,macosx,$(ASM_SOURCES_XXX))
@@ -193,7 +195,9 @@ lib/accelerated/x86/files.mk: $(ASM_SOURCES_ELF)
# Appro's code
lib/accelerated/x86/elf/%.s: devel/perlasm/%.pl .submodule.stamp
- CC=gcc perl $< elf $@.tmp
+ CC=gcc perl $< elf \
+ $(if $(findstring $(@F),$(PL_NEEDS_FPIC)),-fPIC) \
+ $@.tmp
cat $<.license $@.tmp > $@ && rm -f $@.tmp
echo "" >> $@
echo ".section .note.GNU-stack,\"\",%progbits" >> $@
```
--
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/issues/818#note_203669643
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20190814/00f71751/attachment-0001.html>
More information about the Gnutls-devel
mailing list