disabling stack smashing protector

Having trouble with the game? Report issues and get help here. Read this first!

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
Post Reply
qleak
Posts: 4
Joined: February 13th, 2005, 11:07 pm

disabling stack smashing protector

Post by qleak »

One of my computers has a gentoo install with the stack smashing protector and position independent code compiled into all the libraries by default. I would like to compile wesnoth on it with the -fno-stack-protector-all or -fno-stack-protector compiler options but am not sure how to do this :-)

I would rather compile it myself than use gentoo.. but I'm not sure where to add the -fno-stack-protector option in the config process.

Any help would be appriciated
silene
Posts: 1109
Joined: August 28th, 2004, 10:02 pm

Re: disabling stack smashing protector

Post by silene »

qleak wrote:but I'm not sure where to add the -fno-stack-protector option in the config process.
This should work:

Code: Select all

./configure CXXFLAGS=-fno-stack-protector
You will have to add a few flags because you probably want to use more of them (optimization level, architecture target, etc).
energyman76c
Posts: 199
Joined: May 26th, 2004, 9:38 pm

Post by energyman76c »

Hi,

what is wrong with

export USE="-pie" emerge wesnoth?
belt@ ccs.neu.edu

Persistent and flexible solution for gentoo

Post by belt@ ccs.neu.edu »

Albeit untested for wesnoth as of this posting, this solution works for customizing the environment for other packages. For example:
  • /etc/portage/env/x11-base/x11-drm:VIDEO_CARDS=radeon
    /env/media-sound/alsa-driver:ALSA_CARDS=emu10k1
    /etc/portage/env/games-strategy/wesnoth:CFLAGS="$CFLAGS -fno-stack-protector"
1) Add the following to /etc/portage/bashrc

Code: Select all

for conf in ${PN}-${PV}-${PR} ${PN}-${PV} ${PN}; do
        if [[ -f /etc/portage/env/$CATEGORY/${conf} ]]; then
                . /etc/portage/env/$CATEGORY/${conf}
                break
        fi
done
2) Add the following to the file /etc/portage/env/games-strategy/wesnoth

Code: Select all

CFLAGS="${CFLAGS} -fno-stack-protector"
3) (Re)?Compile wesnoth

Code: Select all

emerge wesnoth
Post Reply