Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 699618 - media-gfx/inkscape-1.0_beta1: configure strips gcc-option --param from C/CXXFLAGS
Summary: media-gfx/inkscape-1.0_beta1: configure strips gcc-option --param from C/CXXF...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Graphics Project
URL: https://gitlab.com/inkscape/inkscape/...
Whiteboard:
Keywords:
: 699732 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-11-08 14:46 UTC by Johannes Hirte
Modified: 2019-11-11 09:41 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 Johannes Hirte 2019-11-08 14:46:01 UTC
Build of media-gfx/inkscape-1.0_beta1 fails, because during configuring all  '--param' are stripped from C/CXXFLAGS. So my flags, looking like this:

"-O2 -march=znver1 -mtune=znver1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=512 -ftree-vectorize -fvect-cost-model -pipe"

are left as this:

"-O2 -march=znver1 -mtune=znver1 l1-cache-size=32 l1-cache-line-size=64 l2-cache-size=512 -ftree-vectorize -fvect-cost-model -pipe"

Now the gcc fails, because l1-cache-size=32, l1-cache-line-size=64 and l2-cache-size=512 are invalid options. The error happens when writing the ninja-files. After configuring, cmake summary looks ok:

-- <<< Gentoo configuration >>>
Build type      Gentoo
Install path    /usr
Compiler flags:
C               -O2 -march=znver1 -mtune=znver1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=512 -ftree-vectorize -fvect-cost-model -pipe -fno-strict-aliasing -fopenmp
C++             --param -D_FORTIFY_SOURCE=2 -O2 -U_FORTIFY_SOURCE -Werror=format -Werror=format-security -fno-strict-aliasing -fopenmp -ftree-vectorize -fvect-cost-model -march=znver1 -mtune=znver1 -pipe -pthread l1-cache-line-size=64 l1-cache-size=32 l2-cache-size=512
Linker flags:
Executable      -Wl,-O1 -Wl,--as-needed
Module          -Wl,-O1 -Wl,--as-needed
Shared          -Wl,-O1 -Wl,--as-needed

-- Configuring done
-- Generating done
-- Build files have been written to: /var/tmp/portage/media-gfx/inkscape-1.0_beta1/work/inkscape-1.0_beta1_build
>>> Source configured.

But the ninja-files are missing the '--param' keyword.

Reproducible: Always
Comment 1 Johannes Hirte 2019-11-08 14:46:20 UTC
 emerge --info
Portage 2.3.78 (python 3.6.9-final-0, default/linux/amd64/17.1/systemd, gcc-9.2.0, glibc-2.29-r6, 5.4.0-rc6 x86_64)
=================================================================
System uname: Linux-5.4.0-rc6-x86_64-AMD_Ryzen_5_PRO_2500U_w-_Radeon_Vega_Mobile_Gfx-with-gentoo-2.6
KiB Mem:     7066084 total,   2251920 free
KiB Swap:    2097148 total,   1171732 free
Head commit of repository gentoo: ac12431b14cf9d13db74559d7a82136cf1e50464

Head commit of repository kde: 9f4b041fde5de6d0dc630e52b51f106378240cd2

Head commit of repository qt: d2b6b9559de444d72566a49471cf66f9dbfc19f5

sh bash 5.0_p11
ld GNU ld (Gentoo 2.32 p2) 2.32.0
distcc 3.3.3 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          5.0_p11::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.30.0::gentoo
dev-lang/python:          2.7.16::gentoo, 3.6.9::gentoo
dev-util/cmake:           3.15.5::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/sandbox:         2.18::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.16.1-r2::gentoo
sys-devel/binutils:       2.32-r1::gentoo
sys-devel/gcc:            9.2.0-r2::gentoo
sys-devel/gcc-config:     2.1::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.3-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.29-r6::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: https://anongit.gentoo.org/repo/gentoo.git
    priority: -1000

kde
    location: /usr/local/portage/kde
    sync-type: git
    sync-uri: git://anongit.gentoo.org/proj/kde.git
    masters: gentoo
    priority: 50

qt
    location: /usr/local/portage/qt
    sync-type: git
    sync-uri: git://anongit.gentoo.org/proj/qt.git
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=znver1 -mtune=znver1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=512 -ftree-vectorize -fvect-cost-model -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.3/ext-active/ /etc/php/cgi-php7.3/ext-active/ /etc/php/cli-php7.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=znver1 -mtune=znver1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=512 -ftree-vectorize -fvect-cost-model -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y --quiet-build=n"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -march=znver1 -mtune=znver1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=512 -ftree-vectorize -fvect-cost-model -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync metadata-transfer multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -march=znver1 -mtune=znver1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=512 -ftree-vectorize -fvect-cost-model -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="de en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac aacplus acl alsa alt-svc amd64 amr amrenc anacron berkdb bluetooth bzip2 cairo caps celt chm cleartype_hinting cli corefonts crypt cryptsetup cups cxx d3d9 dav1d dbus default-gold dell device-mapper djvu dri drm dvd ebook editorconfig efi egl eps epub evdev exif faac fdk ffmpeg fftw flac fontconfig fortran gbm gdbm gif git glamor gmp gold gpg gphoto2 gpm graphviz harfbuzz iconv icu id3tag ipv6 ithreads jpeg kipi lcms lensfun libatomic libcxx libcxxabi libffi libinput libkms libsamplerate libtirpc libunwind libxml2 lm-sensors lz4 lzma lzo mad matroska mjpeg mmap mng mobi modern-top mp3 mpeg mtp multilib mysql ncurses networkmanager nfs nls nptl ogg openal opencl opencv openexr opengl openmp openssl opus pam parted pcre pcre16 pdf png policykit postscript pulseaudio python qml qt5 raw readline s3tc schroedinger sdl sdl2 seccomp sift smp sndfile sox speex spice split-usr sqlite ssl subversion svg system-jsoncpp system-sqlite systemd taglib tcpd tesseract theora threads thumbnail tiff truetype udev uefi unicode urandom usb usbredir user-session v4l vaapi vde vdpau vhosts virgl virt-network virtfs vorbis vpx vte vulkan wavpack wayland webp wmf x264 x265 xattr xcb xcomposite xkb xml xmp xpm xv xvid zip zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci 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="karbon sheets words" CAMERAS="canon ricoh ricoh_g3" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 ssse3 sse4_1 sse4_2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-32 efi-64 pc" INPUT_DEVICES="evdev libinput synaptics" KERNEL="linux" L10N="de en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="AMDGPU BPF NVPTX X86" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="pypy pypy3 python2_7 python3_6" RUBY_TARGETS="ruby25" USERLAND="GNU" VIDEO_CARDS="amdgpu" 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"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Johannes Hirte 2019-11-08 14:47:09 UTC
installed cmake: dev-util/cmake-3.15.5:0
Comment 3 Johannes Hirte 2019-11-08 15:35:23 UTC
It's not stripped, but put in front of all flags. I've found lines with correct '--param' options: 

FLAGS = -O2 -march=znver1 -mtune=znver1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=512 -ftree-vectorize -fvect-cost-model -pipe -fno-strict-aliasing -fopenmp -fPIC   -pthread -UWITH_MESH -UWITH_CSSBLEND -UWITH_CSSCOMPOSITE -UWITH_SVG2 -fPIC

When it goes wrong, -D_FORTIFY_SOURCE seems to be involved every time:

FLAGS = --param -D_FORTIFY_SOURCE=2 -O2 -U_FORTIFY_SOURCE -Werror=format -Werror=format-security -fno-strict-aliasing -fopenmp -ftree-vectorize -fvect-cost-model -march=znver1 -mtune=znver1 -pipe -pthread l1-cache-line-size=64 l1-cache-size=32 l2-cache-size=512 -fPIC   -pthread -UWITH_MESH -UWITH_CSSBLEND -UWITH_CSSCOMPOSITE -UWITH_SVG2 -fPIC -std=gnu++11
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-11-10 22:15:17 UTC
*** Bug 699732 has been marked as a duplicate of this bug. ***
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-11-11 07:00:09 UTC
Upstream removed this silly logic 4 weeks ago.
Comment 6 Johannes Hirte 2019-11-11 08:40:16 UTC
(In reply to Michał Górny from comment #5)
> Upstream removed this silly logic 4 weeks ago.

Can confirm, that this patch fix it.
Comment 7 Larry the Git Cow gentoo-dev 2019-11-11 09:41:35 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9a5708b39fd019e2425efea931da5d3b3d2331da

commit 9a5708b39fd019e2425efea931da5d3b3d2331da
Author:     Miroslav Šulc <fordfrog@gentoo.org>
AuthorDate: 2019-11-11 09:41:00 +0000
Commit:     Miroslav Šulc <fordfrog@gentoo.org>
CommitDate: 2019-11-11 09:41:27 +0000

    media-gfx/inkscape-1.0_beta1: fix #699618
    
    avoid reordering of CMAKE_CXX_FLAGS
    
    Closes: https://bugs.gentoo.org/699618
    Package-Manager: Portage-2.3.79, Repoman-2.3.18
    Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>

 ....0_beta1-avoid-reordering-cmake-cxx-flags.patch | 130 +++++++++++++++++++++
 media-gfx/inkscape/inkscape-1.0_beta1.ebuild       |   1 +
 2 files changed, 131 insertions(+)