Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 484072 - dev-db/postgresql-base - pg_config --cflags includes custom CFLAGS
Summary: dev-db/postgresql-base - pg_config --cflags includes custom CFLAGS
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: Normal normal (vote)
Assignee: PgSQL Bugs
URL:
Whiteboard:
Keywords:
: 524324 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-09-07 08:54 UTC by Denis Scherbakov
Modified: 2014-11-03 15:29 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Denis Scherbakov 2013-09-07 08:54:11 UTC
I have a strange problem. Sometime ago I used -flto flag to boost optimisation and used it in my make.profile. Then I removed it.

Now I have: -O2 -march=native -fomit-frame-pointer -pipe

After some time I recompiled GCC without LTO support so now -flto flag is no longer supported by the compiler.

Now I want to rebuild dev-db/postgresql-server. But whatever I do old CFLAGS are picked up: -O2 -march=native -fomit-frame-pointer -flto -pipe. And of course nothing rebuilds because GCC has been compiled without LTO.

My question is: is it a bug or a strange feature? Old CFLAGS seem to be stored somewhere and used. Even after I removed dev-db/postgresql-server and tried to build it from scratch.
Comment 1 Denis Scherbakov 2013-09-07 08:56:16 UTC
emerge --info -v1 dev-db/postgresql-server

Portage 2.1.12.2 (hardened/linux/x86, gcc-4.6.3, glibc-2.15-r3, 3.9.9-hardened i686)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.9.9-hardened-i686-Intel-R-_Xeon-R-_CPU_E5-2620_0_@_2.00GHz-with-gentoo-2.2
KiB Mem:      763916 total,    133748 free
KiB Swap:     786428 total,    785848 free
Timestamp of tree: Sat, 07 Sep 2013 07:15:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
app-shells/bash:          4.2_p45
dev-lang/python:          2.7.5-r2, 3.2.5-r2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.69
sys-devel/automake:       1.11.6, 1.12.6, 1.13.4
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories:

gentoo
    location: /usr/portage
    sync: rsync://rsync.us.gentoo.org/gentoo-portage
    priority: -1000

ABI_X86="32"
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA"
ACCEPT_PROPERTIES="*"
ACCEPT_RESTRICT="*"
ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci"
APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias"
ARCH="x86"
AUTOCLEAN="yes"
BOOTSTRAP_USE="cxx unicode python_targets_python3_2 python_targets_python2_7 hardened pax_kernel pic -jit -orc"
CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author"
CAMERAS="ptp2"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=native -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CLEAN_DELAY="5"
COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog"
COLLISION_IGNORE="/lib/modules/* *.py[co] *$py.class */dropin.cache"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=native -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
EDITOR="/bin/nano"
ELIBC="glibc"
EMERGE_WARNING_DELAY="10"
EPREFIX=""
EROOT="/"
FCFLAGS="-march=i686 -O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch xattr"
FETCHCOMMAND="wget -t 3 -T 60 --passive-ftp -O "${DISTDIR}/${FILE}" "${URI}""
FETCHCOMMAND_RSYNC="rsync -avP "${URI}" "${DISTDIR}/${FILE}""
FETCHCOMMAND_SFTP="bash -c "x=\${2#sftp://} ; host=\${x%%/*} ; port=\${host##*:} ; host=\${host%:*} ; [[ \${host} = \${port} ]] && port=22 ; eval \"declare -a ssh_opts=(\${3})\" ; exec sftp -P \${port} \"\${ssh_opts[@]}\" \"\${host}:/\${x#*/}\" \"\$1\"" sftp "${DISTDIR}/${FILE}" "${URI}" "${PORTAGE_SSH_OPTS}""
FETCHCOMMAND_SSH="bash -c "x=\${2#ssh://} ; host=\${x%%/*} ; port=\${host##*:} ; host=\${host%:*} ; [[ \${host} = \${port} ]] && port=22 ; exec rsync --rsh=\"ssh -p\${port} \${3}\" -avP \"\${host}:/\${x#*/}\" \"\$1\"" rsync "${DISTDIR}/${FILE}" "${URI}" "${PORTAGE_SSH_OPTS}""
FFLAGS="-march=i686 -O2 -pipe"
GCC_SPECS=""
GENTOO_MIRRORS="http://mirror.mcs.anl.gov/pub/gentoo/ http://www.gtlib.gatech.edu/pub/gentoo ftp://ftp.ussg.iu.edu/pub/linux/gentoo ftp://lug.mtu.edu/gentoo/"
GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx"
GRUB_PLATFORMS=""
HOME="/root"
INFOPATH="/usr/share/info:/usr/share/gcc-data/i686-pc-linux-gnu/4.6.3/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.23.1/info"
INPUT_DEVICES="keyboard mouse evdev"
IUSE_IMPLICIT="prefix"
KERNEL="linux"
LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text"
LC_MESSAGES="C"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LESS="-R -M --shift 5"
LESSOPEN="|lesspipe %s"
LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer"
LOGNAME="root"
LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.pdf=00;32:*.ps=00;32:*.txt=00;32:*.patch=00;32:*.diff=00;32:*.log=00;32:*.tex=00;32:*.doc=00;32:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:"
MAIL="/var/mail/root"
MAKEOPTS="-j3"
MANPATH="/usr/local/share/man:/usr/share/man:/usr/share/gcc-data/i686-pc-linux-gnu/4.6.3/man:/usr/share/binutils-data/i686-pc-linux-gnu/2.23.1/man:/usr/lib/php5.5/man/:/usr/share/postgresql/man/:/usr/share/postgresql-9.2/man/"
MULTIOSDIRS="../lib"
NETBEANS="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml"
OFFICE_IMPLEMENTATION="libreoffice"
PAGER="/usr/bin/less"
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.6.3"
PHP_TARGETS="php5-5"
PKGDIR="/usr/portage/packages"
PORTAGE_ARCHLIST="ppc sparc64-freebsd ppc-openbsd x86-openbsd ppc64 x86-winnt x86-fbsd ppc-aix alpha arm x86-freebsd s390 amd64 arm-linux x86-macos x64-openbsd ia64-hpux hppa x86-netbsd ppc64-linux x86-cygwin amd64-linux ia64-linux x86 sparc-solaris x64-freebsd sparc64-solaris x86-linux x64-macos sparc m68k-mint ia64 mips ppc-macos x86-interix hppa-hpux amd64-fbsd x64-solaris m68k sh x86-solaris sparc-fbsd"
PORTAGE_BIN_PATH="/usr/lib/portage/bin"
PORTAGE_COMPRESS_EXCLUDE_SUFFIXES="css gif htm[l]? jp[e]?g js pdf png"
PORTAGE_CONFIGROOT="/"
PORTAGE_DEBUG="0"
PORTAGE_DEPCACHEDIR="/var/cache/edb/dep"
PORTAGE_ELOG_CLASSES="log warn error"
PORTAGE_ELOG_MAILFROM="portage@localhost"
PORTAGE_ELOG_MAILSUBJECT="[portage] ebuild log for ${PACKAGE} on ${HOST}"
PORTAGE_ELOG_MAILURI="root"
PORTAGE_ELOG_SYSTEM="save_summary:log,warn,error,qa echo"
PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS="5"
PORTAGE_FETCH_RESUME_MIN_SIZE="350K"
PORTAGE_GID="250"
PORTAGE_GPG_SIGNING_COMMAND="gpg --sign --digest-algo SHA256 --clearsign --yes --default-key "${PORTAGE_GPG_KEY}" --homedir "${PORTAGE_GPG_DIR}" "${FILE}""
PORTAGE_INST_GID="0"
PORTAGE_INST_UID="0"
PORTAGE_INTERNAL_CALLER="1"
PORTAGE_OVERRIDE_EPREFIX=""
PORTAGE_PYM_PATH="/usr/lib/portage/pym"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_RSYNC_RETRIES="-1"
PORTAGE_SYNC_STALE="30"
PORTAGE_TMPDIR="/var/tmp"
PORTAGE_VERBOSE="1"
PORTAGE_WORKDIR_MODE="0700"
PORTAGE_XATTR_EXCLUDE="security.*"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
PORT_LOGDIR_CLEAN="find "${PORT_LOGDIR}" -type f ! -name "summary.log*" -mtime +7 -delete"
PROFILE_ONLY_VARIABLES="ARCH ELIBC IUSE_IMPLICIT KERNEL USERLAND USE_EXPAND_IMPLICIT USE_EXPAND_UNPREFIXED USE_EXPAND_VALUES_ARCH USE_EXPAND_VALUES_ELIBC USE_EXPAND_VALUES_KERNEL USE_EXPAND_VALUES_USERLAND"
PWD="/root"
PYTHONDONTWRITEBYTECODE="1"
PYTHON_SINGLE_TARGET="python2_7"
PYTHON_TARGETS="python2_7 python3_2"
RESUMECOMMAND="wget -c -t 3 -T 60 --passive-ftp -O "${DISTDIR}/${FILE}" "${URI}""
RESUMECOMMAND_RSYNC="rsync -avP "${URI}" "${DISTDIR}/${FILE}""
RESUMECOMMAND_SSH="bash -c "x=\${2#ssh://} ; host=\${x%%/*} ; port=\${host##*:} ; host=\${host%:*} ; [[ \${host} = \${port} ]] && port=22 ; exec rsync --rsh=\"ssh -p\${port} \${3}\" -avP \"\${host}:/\${x#*/}\" \"\$1\"" rsync "${DISTDIR}/${FILE}" "${URI}" "${PORTAGE_SSH_OPTS}""
ROOT="/"
ROOTPATH="/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.6.3"
RPMDIR="/usr/portage/rpm"
RUBY_TARGETS="ruby19 ruby18"
SHELL="/bin/bash"
SHLVL="1"
SSH_CLIENT="188.174.152.83 12414 22"
SSH_CONNECTION="188.174.152.83 12414 64.237.39.62 22"
SSH_TTY="/dev/pts/0"
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"
TERM="xterm"
UNINSTALL_IGNORE="/lib/modules/*"
USE="acl berkdb bzip2 cracklib crypt cxx dri gdbm hardened iconv ipv6 modules mudflap ncurses nls nptl openmp pam pax_kernel pcre pic postgres readline session ssl syslog tcpd unicode urandom x86 zlib" ABI_X86="32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 intel mach64 mga nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa via vmware nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USER="root"
USERLAND="GNU"
USE_EXPAND="ABI_MIPS ABI_X86 ALSA_CARDS APACHE2_MODULES APACHE2_MPMS CALLIGRA_FEATURES CAMERAS COLLECTD_PLUGINS CROSSCOMPILE_OPTS CURL_SSL DRACUT_MODULES DVB_CARDS ELIBC ENLIGHTENMENT_MODULES FCDSL_CARDS FFTOOLS FOO2ZJS_DEVICES FRITZCAPI_CARDS GPSD_PROTOCOLS GRUB_PLATFORMS INPUT_DEVICES KERNEL LCD_DEVICES LIBREOFFICE_EXTENSIONS LINGUAS LIRC_DEVICES MONKEYD_PLUGINS NETBEANS_MODULES NGINX_MODULES_HTTP NGINX_MODULES_MAIL OFED_DRIVERS OFFICE_IMPLEMENTATION OPENMPI_FABRICS OPENMPI_OFED_FEATURES OPENMPI_RM PHP_TARGETS PYTHON_SINGLE_TARGET PYTHON_TARGETS QEMU_SOFTMMU_TARGETS QEMU_USER_TARGETS RUBY_TARGETS SANE_BACKENDS USERLAND VIDEO_CARDS VOICEMAIL_STORAGE XFCE_PLUGINS XTABLES_ADDONS"
USE_EXPAND_HIDDEN="ABI_MIPS ABI_X86 CROSSCOMPILE_OPTS ELIBC KERNEL USERLAND"
USE_EXPAND_IMPLICIT="ARCH ELIBC KERNEL USERLAND"
USE_EXPAND_UNPREFIXED="ARCH"
USE_EXPAND_VALUES_ARCH="alpha amd64 amd64-fbsd amd64-linux arm arm-linux hppa hppa-hpux ia64 ia64-hpux ia64-linux m68k m68k-mint mips ppc ppc64 ppc64-linux ppc-aix ppc-macos ppc-openbsd s390 sh sparc sparc64-freebsd sparc64-solaris sparc-fbsd sparc-solaris x64-freebsd x64-macos x64-openbsd x64-solaris x86 x86-cygwin x86-fbsd x86-freebsd x86-interix x86-linux x86-macos x86-netbsd x86-openbsd x86-solaris x86-winnt"
USE_EXPAND_VALUES_ELIBC="AIX Cygwin Darwin FreeBSD glibc HPUX Interix mintlib musl NetBSD OpenBSD SunOS uclibc Winnt"
USE_EXPAND_VALUES_KERNEL="AIX Cygwin Darwin FreeBSD freemint HPUX Interix linux NetBSD OpenBSD SunOS Winnt"
USE_EXPAND_VALUES_USERLAND="BSD GNU"
USE_NOT="-cli -mysql -vacation"
USE_ORDER="env:pkg:conf:defaults:pkginternal:repo:env.d"
VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 intel mach64 mga nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa via vmware nouveau"
XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
_="/usr/bin/emerge"
Comment 2 Denis Scherbakov 2013-09-07 08:58:47 UTC
emerge:

>>> Emerging (1 of 1) dev-db/postgresql-server-9.2.4
 * postgresql-9.2.4.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                                                                              [ ok ]
 * postgresql-patches-9.2.tbz2 SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                                                                           [ ok ]
 * postgresql-initscript-2.4.tbz2 SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                                                                        [ ok ]
>>> Unpacking source...
>>> Unpacking postgresql-9.2.4.tar.bz2 to /var/tmp/portage/dev-db/postgresql-server-9.2.4/work
>>> Unpacking postgresql-patches-9.2.tbz2 to /var/tmp/portage/dev-db/postgresql-server-9.2.4/work
>>> Unpacking postgresql-initscript-2.4.tbz2 to /var/tmp/portage/dev-db/postgresql-server-9.2.4/work
>>> Source unpacked in /var/tmp/portage/dev-db/postgresql-server-9.2.4/work
>>> Preparing source in /var/tmp/portage/dev-db/postgresql-server-9.2.4/work/postgresql-9.2.4 ...
 * Applying autoconf.patch ...                                                                                                                                                                [ ok ]
 * Applying bool.patch ...                                                                                                                                                                    [ ok ]
 * Applying server.patch ...                                                                                                                                                                  [ ok ]
 * Adjusting to prefix /
 *   pg_config_manual.h ...                                                                                                                                                                   [ ok ]
 * Running autoconf ...                                                                                                                                                                       [ ok ]
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/dev-db/postgresql-server-9.2.4/work/postgresql-9.2.4 ...
 * econf: updating postgresql-9.2.4/config/config.sub with /usr/share/gnuconfig/config.sub
 * econf: updating postgresql-9.2.4/config/config.guess with /usr/share/gnuconfig/config.guess
./configure --prefix=/usr --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --prefix=/usr --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --prefix=/usr/lib/postgresql-9.2 --datadir=/usr/share/postgresql-9.2 --docdir=/usr/share/doc/postgresql-9.2 --sysconfdir=/etc/postgresql-9.2 --includedir=/usr/include/postgresql-9.2 --mandir=/usr/share/postgresql-9.2/man --without-tcl --without-perl --without-python --with-readline --without-krb5 --without-gssapi --enable-nls= --with-pam --enable-integer-datetimes --with-openssl --disable-thread-safety --with-zlib --without-ldap build_alias=i686-pc-linux-gnu host_alias=i686-pc-linux-gnu CFLAGS=-O2 -march=native -fomit-frame-pointer -flto -pipe LDFLAGS=-Wl,-O1 -Wl,--as-needed LDFLAGS_EX=-Wl,-O1 -Wl,--as-needed LDFLAGS_SL=-Wl,-O1 -Wl,--as-needed --without-perl --without-python --without-tcl --without-libxml --without-libxslt --without-ossp-uuid --with-system-tzdata=/usr/share/zoneinfo --with-includes=/usr/include/postgresql-9.2/ --with-libraries=/usr/lib/postgresql-9.2/lib --enable-nls=
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking which template to use... linux
checking whether to build with 64-bit integer date/time support... yes
checking whether NLS is wanted... yes
checking for default port number... 5432
checking for block size... 8kB
checking for segment size... 1GB
checking for WAL block size... 8kB
checking for WAL segment size... 16MB
checking for i686-pc-linux-gnu-gcc... i686-pc-linux-gnu-gcc
checking whether the C compiler works... no
configure: error: in `/var/tmp/portage/dev-db/postgresql-server-9.2.4/work/postgresql-9.2.4':
configure: error: C compiler cannot create executables
See `config.log' for more details
Comment 3 Denis Scherbakov 2013-09-07 09:26:24 UTC
As you can see CFLAGS contain -flto although I removed it months ago.
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2013-09-07 14:41:05 UTC
# pg_config --cflags
-mschedule=8000 -march=2.0 -ggdb -pipe -Wall -O2 -Wno-comment -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard
Comment 5 Denis Scherbakov 2013-09-07 16:20:46 UTC
Ok, I just serached for all packages that I compiled with -flto and did not recompile since CFLAGS change.

It seems that postgresql-server used CFLAGS from postgresql-base. (In the way that pg-server queries pg-base for CFLAGS and uses them instead of CFLAGS I specified).

I think this is a bug. If I compile pg-server and pg-base with different CFLAGS set - this should be my own problem. But silently using different CFLAGS configuration was the last thing I expected. If there is really a need for CFLAGS to match, then maybe pg-base should be simply always forcibly selected for recompilation (when someone compiles pg-server)?

POINT-A: GCC compiled with -flto support
         edited CFLAGS to include -flto
POINT-B: compiled pg-base
         compiled pg-server
POINT-C: recomiled GCC and dropped -flto support
         removed -flto from CFLAGS
POINT-D: due to ebuild change, need to recompile pg-server
         cannot recompile, because pg-server uses outdated CFLAGS (POINT-B)
Comment 6 Robert McGehee 2013-09-13 13:33:50 UTC
I had a similar problem. I tried changing CFLAGS on the postgresql-server install, but the original CFLAGS were somehow stuck and I wasn't able to change them.

I traced my problem to this line in the ebuild script:
 eval econf "$(${PO}/usr/$(get_libdir)/postgresql-${SLOT}/bin/pg_config --configure)" \

which effectively means that no matter what you pass in, the build is just going to run pg_config --configure to see how the package was last compiled and use that for the installation (and thus overwriting everything you had passed in).

My "fix" was to move the /prefix/usr/lib/postgresql-9.3 out of the way, so that ebuild couldn't find pg_config at all, then install. On that installation, the correct CFLAGS were used (since they weren't overwritten by pg_config) and I could then delete the original (moved) /lib/postgresql-9.3 directory, as the install recreated the directory anyway.

But yes, I agree either this behavior is a bug, or the lack of warning that your optimization parameters are being ignored is a bug.
HTH, Robert
Comment 7 Aaron W. Swenson gentoo-dev 2013-09-14 11:28:16 UTC
This is a symptom of using the split ebuilds.

The real solution is to rebuild dev-db/postgresql-base, the package that builds and installs pg_config.

It is both a bug and a feature. dev-db/postgresql-server must be built using the same flags that were used when building dev-db/postgresql-base. The bug is in the way we handle things.

Eventually I'm going to merge the ebuilds back into one.

Until then, this will not be fixed.
Comment 8 Aaron W. Swenson gentoo-dev 2014-10-05 19:22:03 UTC
*** Bug 524324 has been marked as a duplicate of this bug. ***
Comment 9 Aaron W. Swenson gentoo-dev 2014-11-03 15:29:17 UTC
dev-db/postgresql (the unified ebuilds) have been committed to the tree, along
with virtual package, and dependencies have been updated.

The solution is to use the new, unified ebuilds.