Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=d4ba20f38ecc15764839afad219d6a90a21d6e5b

commit d4ba20f38ecc15764839afad219d6a90a21d6e5b
Author: crazy <cr...@frugalware.org>
Date:   Sun Feb 4 19:47:50 2018 +0100

handle -fstack-protector-strong from noprotector option too

* until next toolchain we are better to have all these as options+=(..)
since not everything seems to work with

diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in
index 3b5fd1d..289f5f0 100644
--- a/etc/makepkg.conf.in
+++ b/etc/makepkg.conf.in
@@ -14,15 +14,14 @@ case $(uname -m) in
x86_64)
CARCH="x86_64"
CHOST="x86_64-frugalware-linux"
-               CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe 
-fstack-protector-strong"
-               CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe 
-fstack-protector-strong"
+               CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe"
+               CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe"
;;
esac

## FLAGS added from makepkg:
## -fno-plt : can be disbled with options+=('plt')
-## options+=('noprotector') allows to manipulate -fstack-protector-strong
-## from FrugalBuild. Eg, to use ..=${CFLAGS/-fstack-protector-strong/}
+## -fstack-protector-strong : can be disabled with options+=('noprotector')
export CARCH CHOST CFLAGS CXXFLAGS

## -Wl,--as-needed is set from makepkg. Disable with options+=('noasneeded')
diff --git a/scripts/makepkg b/scripts/makepkg
index 1673057..47c473d 100755
--- a/scripts/makepkg
+++ b/scripts/makepkg
@@ -1428,10 +1428,7 @@ if [ "$INCHROOT" == "1" ]; then
fi

if ! $ECHO $CFLAGS | grep -q "\-fstack-protector-strong" ; then
-               if [ "`check_option NOPROTECTOR`" ]; then
-                       warning "You disabled stack-protector.. Do that *ONLY*"
-                       warning "when you have a very GOOD reason.."
-               else
+               if [ ! "`check_option NOPROTECTOR`" ]; then
error "Your build/makepkg.conf is broken"
error "CFLAGS is missing -fstack-protector-strong"
error "and options+=('noprotector') is not set.."
@@ -1440,12 +1437,9 @@ if [ "$INCHROOT" == "1" ]; then
fi

if ! $ECHO $CXXFLAGS | grep -q "\-fstack-protector-strong" ; then
-               if [ "`check_option NOPROTECTOR`" ]; then
-                       warning "You disabled stack-protector.. Do that *ONLY*"
-                       warning "when you have a very GOOD reason.."
-               else
+               if [ ! "`check_option NOPROTECTOR`" ]; then
error "Your build/makepkg.conf is broken"
-                       error "CXXFLAGS is missing -fstack-protector-strong 
missing"
+                       error "CXXFLAGS is missing -fstack-protector-strong"
error "and options+=('noprotector') is not set.."
exit 1
fi
@@ -1500,12 +1494,24 @@ if [ "$INCHROOT" == "1" ]; then
export CFLAGS CXXFLAGS
fi

+       ## add before PLT
+       if [ "`check_option NOPROTECTOR`" ]; then
+               warning "Disabling -fstack-protector-strong in C/CXX FLAGS."
+               warning "Do that only with an GOOD reason.."
+       else
+               msg "Enabling -fstack-protector-strong in C/CXX FLAGS"
+               CFLAGS+=" -fstack-protector-strong"
+               CXXFLAGS+=" -fstack-protector-strong"
+               export CFLAGS CXXFLAGS
+       fi
+
if [ "`check_option PLT`" ]; then
-                warning "Disabling -fno-plt FLAGS"
+                warning "Disabling -fno-plt C/CXX FLAGS"
else
msg "Enabling -fno-plt in C/CXX FLAGS"
CFLAGS+=" -fno-plt"
CXXFLAGS+=" -fno-plt"
+               export CFLAGS CXXFLAGS
fi

if [ "`check_option NORELRO`" ]; then
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to