[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"C compiler cannot create executables" with CFLAGS="-Wl, -z, noexecstack

From: Jeffrey Walton
Subject: "C compiler cannot create executables" with CFLAGS="-Wl, -z, noexecstack"
Date: Tue, 17 Sep 2013 19:57:49 -0700

I'm working with a project that uses auto tools. The project's posture
is a tad bit weak, so I want to add some additional flags and options
to harden it. The folks at the project told me to add my flags and
options to CFLAGS and CXXFLAGS.

It looks like autoconf is failing as shown below. When I look at the
log and then the line number, I see the following:

{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "C compiler cannot create executables
See \`config.log' for more details" "$LINENO" 5; }

It appears a linker flag passed through the compiler driver was
consumed by the assembler.

What is the recommended way to work around this issue?


$ export CFLAGS="-Wall -Wextra -Wconversion -Wstrict-overflow
-Wtrampoline -Wl,-z,noexecstack -Wl,-z,noexecheap -Wl,-z,relro
-Wl,-z,now -fPIE -pie -fstack-protector-all -DFORTIFY_SOURCES=2"
$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... cfgaux/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking how to create a ustar tar archive... gnutar
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/Users/jwalton/squid-3.3.9':
configure: error: C compiler cannot create executables
See `config.log' for more details

reply via email to

[Prev in Thread] Current Thread [Next in Thread]