Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 585072 - net-libs/webkit-gtk: Fails to compile with with "-ggdb1" in cflags
Summary: net-libs/webkit-gtk: Fails to compile with with "-ggdb1" in cflags
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-05 08:58 UTC by Bruno
Modified: 2016-10-25 21:31 UTC (History)
0 users

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


Attachments
emerge --info (webkit-gtk-emerge.info,16.13 KB, text/plain)
2016-06-08 12:40 UTC, Bruno
Details
build.log (webkit-gtk-build.log,5.37 KB, text/plain)
2016-06-08 12:42 UTC, Bruno
Details
CMakeError.log (CMakeError.log,2.41 KB, text/plain)
2016-06-08 12:43 UTC, Bruno
Details
Logs for net-libs/webkit-gtk-2.12.5:4 (webkit-gtk_4.tar.gz,48.36 KB, application/gzip)
2016-10-25 07:18 UTC, Bruno
Details
logs for net-libs/webkit-gtk-2.4.11-r1:3 (webkit-gtk_3.tar.gz,52.08 KB, application/gzip)
2016-10-25 07:33 UTC, Bruno
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bruno 2016-06-05 08:58:24 UTC
net-libs/webkit-gtk is stripping some flags from CFLAGS but does so incorrectly.

If I have "-ggdb1" in my CFLAGS to limit debugging information generated src_configure fails claiming that compiler does not work.

The resulting compiler cmdline includes a lone " 1 " that seems left from s/-ggdb// kind of sed on CFLAGS. Just removing the -ggdb1 from CFLAGS gets the package to configure and compile.
Comment 1 Pacho Ramos gentoo-dev 2016-06-06 10:22:47 UTC
Please provide the build.log and emerge --info as, per the ebuild code, it is only replacing the concrete -ggdb flag:
pkg_setup() {
        # Check whether any of the debugging flags is enabled
        if [[ ${MERGE_TYPE} != "binary" ]] && is-flagq "-g*" && ! is-flagq "-g*0" ; then
                if is-flagq "-ggdb" && [[ ${WEBKIT_GTK_GGDB} != "yes" ]]; then
                        replace-flags -ggdb -g
                        ewarn "Replacing \"-ggdb\" with \"-g\" in your CFLAGS."
                        ewarn "Building ${PN} with \"-ggdb\" produces binaries which are too"
                        ewarn "large for current binutils releases (bug #432784) and has very"
                        ewarn "high temporary build space and memory requirements."
                        ewarn "If you really want to build ${PN} with \"-ggdb\", add"
                        ewarn "WEBKIT_GTK_GGDB=yes"
                        ewarn "to your make.conf file."
                fi
                einfo "You need to have at least 18GB of temporary build space available"
                einfo "to build ${PN} with debugging CFLAGS. Note that it might still"
                einfo "not be enough, as the total space requirements depend on the flags"
                einfo "(-ggdb vs -g1) and enabled features."
                check-reqs_pkg_setup
        fi

        [[ ${MERGE_TYPE} = "binary" ]] || python-any-r1_pkg_setup
}
Comment 2 Bruno 2016-06-08 12:40:02 UTC
Created attachment 436858 [details]
emerge --info
Comment 3 Bruno 2016-06-08 12:42:14 UTC
Created attachment 436860 [details]
build.log
Comment 4 Bruno 2016-06-08 12:43:18 UTC
Created attachment 436862 [details]
CMakeError.log

CMakeOutput.log:
The system is: Linux - 4.6.0 - x86_64
Comment 5 Bruno 2016-06-08 12:55:50 UTC
Problem applies at least to:
  net-libs/webkit-gtk-2.10.9:4
  net-libs/webkit-gtk-2.4.10:3
Comment 6 Gilles Dartiguelongue (RETIRED) gentoo-dev 2016-10-25 07:04:26 UTC
If you still have this problem it would be interesting to see the logs from webkit-gtk-2.4 as it is autotools based. All I see from cmake is that for some reason it doesn't seem to find gcc, which is strange to say the least.
Comment 7 Bruno 2016-10-25 07:18:34 UTC
Created attachment 451380 [details]
Logs for net-libs/webkit-gtk-2.12.5:4

It still applies to net-libs/webkit-gtk-2.12.5:4.

*** output ***
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "/usr/bin/x86_64-pc-linux-gnu-gcc" is not able to compile a
  simple test program.

  It fails with the following output:

   Change Dir: /var/cache/tmp/portage/net-libs/webkit-gtk-2.12.5/work/webkit-gtk-2.12.5_build/CMakeFiles/CMakeTmp



  Run Build Command:"/usr/bin/ninja" "cmTC_ef50c"

  [1/2] Building C object CMakeFiles/cmTC_ef50c.dir/testCCompiler.c.o

  FAILED: /usr/bin/x86_64-pc-linux-gnu-gcc -DENABLE_JIT=0 -DENABLE_YARR_JIT=0
  -DENABLE_ASSEMBLER=0 -DNDEBUG -O2 -march=nocona -pipe 1
  -fno-strict-aliasing -o CMakeFiles/cmTC_ef50c.dir/testCCompiler.c.o -c
  testCCompiler.c

  x86_64-pc-linux-gnu-gcc: error: 1: No such file or directory

  ninja: build stopped: subcommand failed.

*** end of output ***


If I replace -ggdb1 with -ggdb2 the output turns as follows:

*** output ***
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "/usr/bin/x86_64-pc-linux-gnu-gcc" is not able to compile a
  simple test program.

  It fails with the following output:

   Change Dir: /var/cache/tmp/portage/net-libs/webkit-gtk-2.12.5/work/webkit-gtk-2.12.5_build/CMakeFiles/CMakeTmp



  Run Build Command:"/usr/bin/ninja" "cmTC_dc698"

  [1/2] Building C object CMakeFiles/cmTC_dc698.dir/testCCompiler.c.o

  FAILED: /usr/bin/x86_64-pc-linux-gnu-gcc -DENABLE_JIT=0 -DENABLE_YARR_JIT=0
  -DENABLE_ASSEMBLER=0 -DNDEBUG -O2 -march=nocona -pipe 2
  -fno-strict-aliasing -o CMakeFiles/cmTC_dc698.dir/testCCompiler.c.o -c
  testCCompiler.c

  x86_64-pc-linux-gnu-gcc: error: 2: No such file or directory

  ninja: build stopped: subcommand failed.
*** end of output ***

This looks as if "-ggdb1" was turned into "1" and "-ggdb2" turned into "2".

Tarball contents:
  portage/net-libs/webkit-gtk-2.12.5/work/webkit-gtk-2.12.5_build/CMakeFiles/CMakeOutput.log
  portage/net-libs/webkit-gtk-2.12.5/work/webkit-gtk-2.12.5_build/CMakeFiles/CMakeError.log
  portage/net-libs/webkit-gtk-2.12.5/temp/build.log
  portage/net-libs/webkit-gtk-2.12.5/temp/environment
Comment 8 Bruno 2016-10-25 07:33:30 UTC
Created attachment 451394 [details]
logs for net-libs/webkit-gtk-2.4.11-r1:3

net-libs/webkit-gtk-2.4.11-r1:3 is not much better, using autotools instead of cmake lets the output be different but with equivalent end result:

*** output ***
onfigure: loading site script /usr/share/config.site
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for perl... /usr/bin/perl
checking for python... /usr/bin/python2.7
checking for ruby... /usr/bin/ruby20
checking for bison... /usr/bin/bison
checking for mv... /bin/mv
checking for grep... /bin/grep
checking for gperf... /usr/bin/gperf
checking for flex... /usr/bin/flex
checking for gawk... gawk
checking for x86_64-pc-linux-gnu-gcc... x86_64-pc-linux-gnu-gcc
checking whether the C compiler works... no
configure: error: in `/var/cache/tmp/portage/net-libs/webkit-gtk-2.4.11-r1/work/webkitgtk-2.4.11':
configure: error: C compiler cannot create executables
See `config.log' for more details

!!! Please attach the following file when seeking support:
!!! /var/cache/tmp/portage/net-libs/webkit-gtk-2.4.11-r1/work/webkitgtk-2.4.11/config.log
*** end of output***

From config.log, the problematic part is:
 configure:3859: x86_64-pc-linux-gnu-gcc -O2 -march=nocona -pipe 1  -DENABLE_JIT=0 -DENABLE_YARR_JIT=0 -DENABLE_ASSEMBLER=0 -Wl,-O1 -Wl,--as-needed -Wl,--no-keep-memory -Wl,--reduce-memory-overheads conftest.c  >&5
x86_64-pc-linux-gnu-gcc: error: 1: No such file or directory


When using -ggdb2 it changes to
configure:3859: x86_64-pc-linux-gnu-gcc -O2 -march=nocona -pipe 2  -DENABLE_JIT=0 -DENABLE_YARR_JIT=0 -DENABLE_ASSEMBLER=0 -Wl,-O1 -Wl,--as-needed -Wl,--no-keep-memory -Wl,--reduce-memory-overheads conftest.c  >&5
x86_64-pc-linux-gnu-gcc: error: 2: No such file or directory


Which implies that for both slots the -ggdb1 (or -ggdb2) argument gets incorrectly converted into 1 (or 2), kind of  "echo $cmline | sed s/-ggdb//".


Use of "debug" USE-flag makes no difference.
Comment 9 Gilles Dartiguelongue (RETIRED) gentoo-dev 2016-10-25 07:38:32 UTC
I tried this and it worked here:
# CFLAGS="-O2 -march=native -ggdb1" CXXFLAGS="-O2 -march=native -ggdb1" emerge -1B =webkit-gtk-2.12.5
Comment 10 Gilles Dartiguelongue (RETIRED) gentoo-dev 2016-10-25 07:41:37 UTC
According to the 2.4.11 config.log, the configure is never passed -ggdb1, but 1 directly.

"configure:3859: x86_64-pc-linux-gnu-gcc -O2 -march=nocona -pipe 1  -DENABLE_JIT=0 -DENABLE_YARR_JIT=0 -DENABLE_ASSEMBLER=0 -Wl,-O1 -Wl,--as-needed -Wl,--no-keep-memory -Wl,--reduce-memory-overheads conftest.c  >&5"

Are you running some custom /etc/portage/bashrc ?
Comment 11 Bruno 2016-10-25 08:41:53 UTC
(In reply to Gilles Dartiguelongue from comment #9)
> I tried this and it worked here:
> # CFLAGS="-O2 -march=native -ggdb1" CXXFLAGS="-O2 -march=native -ggdb1"
> emerge -1B =webkit-gtk-2.12.5

Ok, I found the cause, a few years ago I added /etc/portage/env/... for a few packages (webkit-gtk & firefox) to strip -ggdb via bash substitutions ( CFLAGS=${CGLAFS/-ggdb/}) there not taking into account the optional level.
Probably because at the time I didn't go the route of debug levels and -ggdb producing just too much data for those bigger packages.


Though now I trip on the ebuild wanting at least 18GB free space to consider building with -ggdb1... (hard to know what is the right value as level will influence amount of debug data produced)
Comment 12 Gilles Dartiguelongue (RETIRED) gentoo-dev 2016-10-25 21:31:11 UTC
As an alternative you can try to use this solution https://github.com/EvaSDK/etc-portage/blob/master/env/no-debug.conf. I have used it for a few years without any problem.