build: Actually use $LDFLAGS when linking

Otherwise annocheck complains that the binary has been linked without
-pie.
This commit is contained in:
Timm Bäder 2020-11-23 15:30:09 +01:00
parent c69927d70e
commit c3edda7f2d
2 changed files with 16 additions and 0 deletions

View File

@ -8,6 +8,8 @@ URL: http://byaccj.sourceforge.net/
Source0: http://sourceforge.net/projects/byaccj/files/byaccj/1.15/byaccj1.15_src.tar.gz
Patch0: honor-ldflags.patch
BuildRequires: gcc
BuildRequires: make
@ -28,6 +30,8 @@ Java now!
chmod -c -x src/* docs/*
sed -i -e 's|-arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4||g' src/Makefile
%autopatch -p1
%build
pushd src
make yacc CFLAGS="%{optflags}" LDFLAGS="$RPM_LD_FLAGS"

12
honor-ldflags.patch Normal file
View File

@ -0,0 +1,12 @@
diff -ruN byaccj1.15.orig/src/Makefile byaccj1.15/src/Makefile
--- byaccj1.15.orig/src/Makefile 2020-11-23 15:20:38.376711773 +0100
+++ byaccj1.15/src/Makefile 2020-11-23 15:20:58.680671903 +0100
@@ -75,7 +75,7 @@
$(CC) -c $(CFLAGS) $(INC) $< -o $@
yacc: $(OBJ)
- $(CC) -o yacc $(OBJ)
+ $(CC) -o yacc $(LDFLAGS) $(OBJ)
@echo "done"
clean: