Discussion:
svn commit: r217101 - head/lib/libcompiler_rt
(too old to reply)
Konstantin Belousov
2011-01-07 14:35:46 UTC
Permalink
Author: kib
Date: Fri Jan 7 14:35:45 2011
New Revision: 217101
URL: http://svn.freebsd.org/changeset/base/217101

Log:
On amd64 and i386, force assembler to mark objects compiled from the
assembler source for libcompiler_rt as not needed executable stack. This
is done with a hammer instead of properly marking each assembly file
with section .note.GNU-stack to avoid modifying contributed source.

Discussed with: ed

Modified:
head/lib/libcompiler_rt/Makefile

Modified: head/lib/libcompiler_rt/Makefile
==============================================================================
--- head/lib/libcompiler_rt/Makefile Fri Jan 7 14:32:29 2011 (r217100)
+++ head/lib/libcompiler_rt/Makefile Fri Jan 7 14:35:45 2011 (r217101)
@@ -156,4 +156,10 @@ SYMLINKS+=libcompiler_rt_p.a ${LIBDIR}/l
. endif
.endif

+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
+AFLAGS+=--noexecstack
+ACFLAGS+=-Wl,a,--noexecstack
+.endif
+
+
.include <bsd.lib.mk>
Anonymous
2011-01-07 15:05:16 UTC
Permalink
Post by Konstantin Belousov
Author: kib
Date: Fri Jan 7 14:35:45 2011
New Revision: 217101
URL: http://svn.freebsd.org/changeset/base/217101
On amd64 and i386, force assembler to mark objects compiled from the
assembler source for libcompiler_rt as not needed executable stack. This
is done with a hammer instead of properly marking each assembly file
with section .note.GNU-stack to avoid modifying contributed source.
Discussed with: ed
head/lib/libcompiler_rt/Makefile
Modified: head/lib/libcompiler_rt/Makefile
==============================================================================
--- head/lib/libcompiler_rt/Makefile Fri Jan 7 14:32:29 2011 (r217100)
+++ head/lib/libcompiler_rt/Makefile Fri Jan 7 14:35:45 2011 (r217101)
@@ -156,4 +156,10 @@ SYMLINKS+=libcompiler_rt_p.a ${LIBDIR}/l
. endif
.endif
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
+AFLAGS+=--noexecstack
+ACFLAGS+=-Wl,a,--noexecstack
+.endif
Typo? -Wl,a,--foo vs. -Wa,--foo. From gcc(1) manpage

Assembler Option
-Wa,option -Xassembler option

Linker Options
-Wl,option -Xlinker option
Kostik Belousov
2011-01-07 16:06:52 UTC
Permalink
Post by Anonymous
Post by Konstantin Belousov
Author: kib
Date: Fri Jan 7 14:35:45 2011
New Revision: 217101
URL: http://svn.freebsd.org/changeset/base/217101
On amd64 and i386, force assembler to mark objects compiled from the
assembler source for libcompiler_rt as not needed executable stack. This
is done with a hammer instead of properly marking each assembly file
with section .note.GNU-stack to avoid modifying contributed source.
Discussed with: ed
head/lib/libcompiler_rt/Makefile
Modified: head/lib/libcompiler_rt/Makefile
==============================================================================
--- head/lib/libcompiler_rt/Makefile Fri Jan 7 14:32:29 2011 (r217100)
+++ head/lib/libcompiler_rt/Makefile Fri Jan 7 14:35:45 2011 (r217101)
@@ -156,4 +156,10 @@ SYMLINKS+=libcompiler_rt_p.a ${LIBDIR}/l
. endif
.endif
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
+AFLAGS+=--noexecstack
+ACFLAGS+=-Wl,a,--noexecstack
+.endif
Typo? -Wl,a,--foo vs. -Wa,--foo. From gcc(1) manpage
Assembler Option
-Wa,option -Xassembler option
Linker Options
-Wl,option -Xlinker option
Thank you. Should be fixed in r217102.

Loading...