Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build with the new -D_FORTIFY_SOURCE=2 #72

Open
szabba opened this issue May 4, 2014 · 3 comments
Open

Unable to build with the new -D_FORTIFY_SOURCE=2 #72

szabba opened this issue May 4, 2014 · 3 comments

Comments

@szabba
Copy link

szabba commented May 4, 2014

Maybe it's something with my environment, but the following happens when I try to follow the instructions from INSTALL.md:

# git clone https://github.com/perl11/potion
Cloning into 'potion'...
remote: Reusing existing pack: 11270, done.
remote: Total 11270 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (11270/11270), 5.14 MiB | 1.08 MiB/s, done.
Resolving deltas: 100% (6523/6523), done.
Checking connectivity... done.
# cd potion 
# git submodule update --init               
Submodule '3rd/libuv' (git://github.com/rurban/libuv.git) registered for path '3rd/libuv'
Cloning into '3rd/libuv'...
remote: Counting objects: 19389, done.
remote: Compressing objects: 100% (7887/7887), done.
remote: Total 19389 (delta 11445), reused 19389 (delta 11445)
Receiving objects: 100% (19389/19389), 11.25 MiB | 2.02 MiB/s, done.
Resolving deltas: 100% (11445/11445), done.
Checking connectivity... done.
Submodule path '3rd/libuv': checked out 'b712aba084b41e2abe8ddbbaaa0843781b558be9'
# LANG=en make
MAKE core/version.h
MAKE core/config.h
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_COLLATE = "C",
    LANG = "en"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
CC core/potion.opic -O0
In file included from core/potion.c:8:
In file included from /usr/include/stdio.h:27:
/usr/include/features.h:341:4: error: _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror,-W#warnings]
#  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
   ^
1 error generated.
Makefile:183: recipe for target 'core/potion.opic' failed
make: *** [core/potion.opic] Error 1
@rurban
Copy link
Member

rurban commented May 5, 2014

oops, thanks for the heads up, but it looks strange. _FORTIFY_SOURCE is only used when DEBUG is not set, so CFLAGS has -O3. Can you check your config.inc for DEBUGFLAGS including -O3?

@szabba
Copy link
Author

szabba commented May 5, 2014

Yup, my config.inc does contain -O3 in DEBUGFLAGS. Any ideas on why this might be?

# -*- makefile -*-
# created by make -f config.mak
PREFIX  = /usr/local
ECHO    = /bin/echo
EXE     =
DLL     = .so
LOADEXT = .so
CC      = clang
DEFINES = -DHAVE_LIBUV -DCGOTO
DEBUGFLAGS = -O3 -finline -fno-stack-protector
WARNINGS   = -Wall -Werror -Wno-variadic-macros -Wno-pointer-arith -Wno-return-type -Wno-unused-value -Wno-switch -Wno-unused-label -Wno-zero-length-array -Wno-gnu
CFLAGS  = -D_GNU_SOURCE -fno-strict-aliasing -D_FORTIFY_SOURCE=2  ${DEFINES} ${DEBUGFLAGS} ${WARNINGS}
INCS    = -I/home/karol/Code/potion/core -I/usr/local/include
LIBPTH  = -L/home/karol/Code/potion/lib
RPATH   = -Wl,-rpath=/home/karol/Code/potion/lib
RPATH_INSTALL =  -Wl,-rpath=${PREFIX}/lib
LIBS    = -lm -L/usr/local/lib -ldl
LDFLAGS =  -Wl,--as-needed -Wl,-z,relro -Wl,-z,now
LDDLLFLAGS = -shared -fpic  -Wl,--as-needed -Wl,-z,relro -Wl,-z,now
STRIP   = strip -x
AR      = ar
RANLIB  = ranlib
CROSS   = 0
APPLE   = 0
WIN32   = 0
CYGWIN  = 0
CLANG   = 1
ICC     = 0
GCC     = 0
SANDBOX = 0
JIT     = 1
JIT_X86 = 1
DEBUG   = 0
REVISION  =  1136

@rurban
Copy link
Member

rurban commented May 5, 2014

All looks good. I have no idea why it fails for you (selinux?) but for now just remove the
-D_FORTIFY_SOURCE=2 part from your config.inc
googling brought up nothing.

maybe you have an env var DEBUGFLAGS set?
try unset DEBUGFLAGS then

@rurban rurban changed the title Unable to build Unable to build with the new -D_FORTIFY_SOURCE=2 Aug 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants