public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/elfix:master commit in: misc/fix-gnustack/tests/
@ 2023-01-10  5:21 Sam James
  0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2023-01-10  5:21 UTC (permalink / raw
  To: gentoo-commits

commit:     4fb8a9cb2a5410aa565d028bd8deb53d8682da62
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  6 05:39:13 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jan 10 05:21:39 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elfix.git/commit/?id=4fb8a9cb

fix-gnustack: respect CFLAGS, LDFLAGS for tests

Needed to correctly run tests with Clang, as Clang doesn't create
executable stacks by default.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 misc/fix-gnustack/tests/Makefile.am | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/misc/fix-gnustack/tests/Makefile.am b/misc/fix-gnustack/tests/Makefile.am
index 9db0fd7..ad573a3 100644
--- a/misc/fix-gnustack/tests/Makefile.am
+++ b/misc/fix-gnustack/tests/Makefile.am
@@ -5,11 +5,11 @@ noinst_PROGRAMS = bad-gnustack
 EXTRA_DIST = gnustacktest.sh
 
 bad-gnustack.s: bad-gnustack.c
-	$(CC) -S $<
+	$(CC) $(CPPFLAGS) $(CFLAGS) -S $<
 	$(SED) -i -e 's/GNU-stack,"",/GNU-stack,"x",/' $@
 
 bad-gnustack$(EXEEXT): bad-gnustack.s
-	$(CC) -o $@ $<
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
 
 check_SCRIPTS = gnustacktest
 TEST = $(check_SCRIPTS)


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] proj/elfix:master commit in: misc/fix-gnustack/tests/
@ 2023-01-10  5:21 Sam James
  0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2023-01-10  5:21 UTC (permalink / raw
  To: gentoo-commits

commit:     87ca5c5bbe63ea3c9227fdd4a01ccdc1ce723323
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  6 05:39:43 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jan 10 05:21:39 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elfix.git/commit/?id=87ca5c5b

fix-gnustack: add 'set -x' in tests for easier debugging

It's hard to see why something failed otherwise, as we only have the
exit code.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 misc/fix-gnustack/tests/gnustacktest.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/misc/fix-gnustack/tests/gnustacktest.sh b/misc/fix-gnustack/tests/gnustacktest.sh
index f200baf..eba0fba 100755
--- a/misc/fix-gnustack/tests/gnustacktest.sh
+++ b/misc/fix-gnustack/tests/gnustacktest.sh
@@ -16,6 +16,7 @@
 #    You should have received a copy of the GNU General Public License
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
+set -x
 
 before=$(../fix-gnustack -f bad-gnustack)
 before=$(echo ${before} | awk '{ print $2 }')


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] proj/elfix:master commit in: misc/fix-gnustack/tests/
@ 2023-01-11  7:54 Sam James
  0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2023-01-11  7:54 UTC (permalink / raw
  To: gentoo-commits

commit:     c8a1d365ff1349cc438352917863ed98ee34a80f
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 11 07:09:53 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jan 11 07:16:07 2023 +0000
URL:        https://gitweb.gentoo.org/proj/elfix.git/commit/?id=c8a1d365

fix-gnustack: pass -Wl,-z,execstack for tests with Clang

Clang doesn't create executable stacks by default, so we need to force it
for the purposes of the tests.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 misc/fix-gnustack/tests/Makefile.am | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/misc/fix-gnustack/tests/Makefile.am b/misc/fix-gnustack/tests/Makefile.am
index ad573a3..17bec0d 100644
--- a/misc/fix-gnustack/tests/Makefile.am
+++ b/misc/fix-gnustack/tests/Makefile.am
@@ -8,8 +8,10 @@ bad-gnustack.s: bad-gnustack.c
 	$(CC) $(CPPFLAGS) $(CFLAGS) -S $<
 	$(SED) -i -e 's/GNU-stack,"",/GNU-stack,"x",/' $@
 
+# Clang doesn't create executable stacks by default, so
+# tests for fix-gnustack fail without this.
 bad-gnustack$(EXEEXT): bad-gnustack.s
-	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
+	$(CC) $(CFLAGS) $(LDFLAGS) -Wl,-z,execstack -o $@ $<
 
 check_SCRIPTS = gnustacktest
 TEST = $(check_SCRIPTS)


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-11  7:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-10  5:21 [gentoo-commits] proj/elfix:master commit in: misc/fix-gnustack/tests/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2023-01-10  5:21 Sam James
2023-01-11  7:54 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox