Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: Autotools configure gcc problem using makepkg  (Read 352 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Autotools configure gcc problem using makepkg

Trying to build the ordinary system packages which or less from the current Artix pkgbuilds, it fails on some gcc error, yet gcc seems to work OK, it seems the configure script is feeding it nonsense commands, not sure how or why, as obviously they used to build fine, I only just discovered this and thought it worthwhile reporting here:


Code: [Select]
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/tmp/which/src/which-2.21':
configure: error: C compiler cannot create executables
See `config.log' for more details
==> ERROR: A failure occurred in build().
    Aborting...


gcc version 12.2.0 (GCC)
configure:3181: $? = 0
configure:3170: gcc -V >&5
gcc: error: unrecognized command-line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3181: $? = 1
configure:3170: gcc -qversion >&5
gcc: error: unrecognized command-line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.
configure:3181: $? = 1
configure:3201: checking whether the C compiler works
configure:3223: gcc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat #        -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=form
at-security         -fstack-clash-protection -fcf-protection  -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now conftest.c  >&5
/usr/bin/ld: cannot find #: No such file or directory
collect2: error: ld returned 1 exit status
configure:3227: $? = 1
configure:3265: result: no

Re: Autotools configure gcc problem using makepkg

Reply #1
What is the name of the PKGBUILD so I can also try it? gcc and autotools just worked fine for compiling the dash shell.

Re: Autotools configure gcc problem using makepkg

Reply #2
Package which builds absolutely fine in a chroot.
Fake news.  :o

If you use makepkg, you might have to update the system.

Re: Autotools configure gcc problem using makepkg

Reply #3
Quote
configure:3223: gcc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat #       -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=form
at-security         -fstack-clash-protection -fcf-protection  -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now conftest.c  >&5
There's a comment tag in there. I doubt it belongs ?
Have a look in /etc/makepkg.conf

That's my guess  :)

Re: Autotools configure gcc problem using makepkg

Reply #4
Thank you, swapping /etc/makepkg.conf for /etc/makepkg.conf.pacnew fixed this, there were some changes in there to build debug versions of packages that had been commented out, although I had not seen problems in the past doing similar things. I think it was this section that must have caused it, with the backslash on the preceding line being read as escaping the comment on the next line instead of escaping the line feed:


Code: [Select]
#-- Compiler and Linker Flags
#CPPFLAGS=""
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions \
        -Wp,-D_FORTIFY_SOURCE=2 -Wformat \
#        -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
        -fstack-clash-protection -fcf-protection"

 

Re: Autotools configure gcc problem using makepkg

Reply #5
Glad to have helped.
But looking at the above the issue is the # within the double quoted string.
The backslashes do escape the LF's.
The # is treated the same as any other character so that line was never commented, just passed to gcc as it's written.

https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html
Quote
3.1.2.3 Double Quotes

Enclosing characters in double quotes (‘"’) preserves the literal value of all characters within the quotes, with the exception of ‘$’, ‘`’, ‘\’, and, when history expansion is enabled, ‘!’.