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

gcc11 requires -fPIE #24

Open
kollienne opened this issue Mar 3, 2022 · 1 comment
Open

gcc11 requires -fPIE #24

kollienne opened this issue Mar 3, 2022 · 1 comment

Comments

@kollienne
Copy link

kollienne commented Mar 3, 2022

With gcc11 CXXFLAGS=-fPIE is required to install, otherwise ./configure (or installing via R) fails with the following output:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by seqminer configure 8.3, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure 

## --------- ##
## Platform. ##
## --------- ##

hostname = xpc15a6.math.canterbury.ac.nz
uname -m = x86_64
uname -r = 5.16.8-200.fc35.x86_64
uname -s = Linux
uname -v = #1 SMP PREEMPT Tue Feb 8 20:58:59 UTC 2022

/usr/bin/uname -p = x86_64
/bin/uname -X     = unknown

/bin/arch              = x86_64
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /home/kieran/.emacs.d/bin
PATH: /usr/condabin
PATH: /usr/lib64/ccache
PATH: /usr/local/bin
PATH: /usr/local/sbin
PATH: /usr/bin
PATH: /usr/sbin
PATH: /var/lib/snapd/snap/bin
PATH: /home/kieran/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2057: CC = gcc -m64
configure:2059: CFLAGS = 
configure:2061: CXX = g++ -m64 -std=gnu++11
configure:2063: CXXFLAGS = -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
configure:2184: checking for C++ compiler version
configure:2193: g++ -m64 -std=gnu++11 --version >&5
g++ (GCC) 11.2.1 20220127 (Red Hat 11.2.1-9)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:2204: $? = 0
configure:2193: g++ -m64 -std=gnu++11 -v >&5
Using built-in specs.
COLLECT_GCC=/usr/bin/g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-11.2.1-20220127/obj-x86_64-redhat-linux/isl-install --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux --with-build-config=bootstrap-lto --enable-link-serialization=1
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.1 20220127 (Red Hat 11.2.1-9) (GCC) 
... rest of stderr output deleted ...
configure:2204: $? = 0
configure:2193: g++ -m64 -std=gnu++11 -V >&5
g++: error: unrecognized command-line option '-V'
g++: fatal error: no input files
compilation terminated.
configure:2204: $? = 1
configure:2193: g++ -m64 -std=gnu++11 -qversion >&5
g++: error: unrecognized command-line option '-qversion'; did you mean '--version'?
g++: fatal error: no input files
compilation terminated.
configure:2204: $? = 1
configure:2224: checking whether the C++ compiler works
configure:2246: g++ -m64 -std=gnu++11  -I/usr/local/include -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 conftest.cpp  >&5
configure:2250: $? = 0
configure:2298: result: yes
configure:2301: checking for C++ compiler default output file name
configure:2303: result: a.out
configure:2309: checking for suffix of executables
configure:2316: g++ -m64 -std=gnu++11 -o conftest  -I/usr/local/include -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 conftest.cpp  >&5
configure:2320: $? = 0
configure:2342: result: 
configure:2364: checking whether we are cross compiling
configure:2372: g++ -m64 -std=gnu++11 -o conftest  -I/usr/local/include -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 conftest.cpp  >&5
/usr/bin/ld: /tmp/ccIrYH7b.o: relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIE
collect2: error: ld returned 1 exit status
configure:2376: $? = 1
configure:2383: ./conftest
./configure: line 2385: ./conftest: No such file or directory
configure:2387: $? = 127
configure:2394: error: in `/home/kieran/src/seqminer':
configure:2396: error: cannot run C++ compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=

## ----------------- ##
## Output variables. ##
## ----------------- ##

CPPFLAGS='-I/usr/local/include'
CXX='g++ -m64 -std=gnu++11'
CXXCPP=''
CXXFLAGS=''
DEFS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
GREP=''
HAVE_BZIP2=''
HAVE_SQLITE=''
HAVE_ZSTD=''
LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1'
LIBOBJS=''
LIBS=''
LTLIBOBJS=''
OBJEXT=''
PACKAGE_BUGREPORT='[email protected]'
PACKAGE_NAME='seqminer'
PACKAGE_STRING='seqminer 8.3'
PACKAGE_TARNAME='seqminer'
PACKAGE_URL=''
PACKAGE_VERSION='8.3'
PATH_SEPARATOR=':'
PKG_CFLAGS=''
PKG_CPPFLAGS=''
PKG_LIBS=''
SHELL='/bin/sh'
ac_ct_CXX=''
bindir='${exec_prefix}/bin'
build_alias=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host_alias=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
runstatedir='${localstatedir}/run'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "seqminer"
#define PACKAGE_TARNAME "seqminer"
#define PACKAGE_VERSION "8.3"
#define PACKAGE_STRING "seqminer 8.3"
#define PACKAGE_BUGREPORT "[email protected]"
#define PACKAGE_URL ""

configure: exit 1
@zhanxw
Copy link
Owner

zhanxw commented Mar 4, 2022

Sorry that I cannot replicate this error on my end.
Ubuntu: Ubuntu 20.04.3 LTS
GCC: 11.2.0

Maybe you can try to manually modify CFLAGS or CXXFLAGS?

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