Discussion:
[blfs-support] Cups-2.2.7 with clang 6 installed
Bruce Dubbs
2018-06-07 04:30:56 UTC
Permalink
CC=gcc: This environment variable ensures that gcc is used, if clang is installed. Remove it, if you prefer to use clang. Using clang almost doubles build time and slightly decreases build disk
space. Installed disk space is not appreciably modified.
I found that just having CC=gcc was not enough to get this to correctly build, as for some reason the build would still try using clang to, if I have the term correct, linking, ie using clang
equivalent of g++
This was not my doing. I am just following what is currently listed in svn for the instructions for both systemd version and for sysv of the book.
Christopher.
FWIW, I've been using both CC=gcc CXX=g++ in my Cups build for quite some time, for the very same reason mentioned by Christopher.
Looking back at my history, it was at the time when -DLLVM_LINK_LLVM_DYLIB=ON was added to llvm.
Wayne.
I don't dny your experience, but I have in my logs/scripts:

Fri May 11 20:34:12 CDT 2018 /usr/src/llvm/llvm-6.0.0.src.tar.xz
Tue May 15 16:10:10 CDT 2018 /usr/src/cups/cups-2.2.7-source.tar.gz

CC=gcc \
./configure --libdir=/usr/lib \
--disable-systemd \
--with-rcdir=/tmp/cupsinit \
--with-system-groups=lpadmin \
--with-docdir=/usr/share/cups/doc-$VER

For llvm I do have -DLLVM_LINK_LLVM_DYLIB=ON

In my cups build log I have:

Using CC=gcc
Using CXX=gcc

In my build directory, there are no .cc or .cpp files.

I cannot duplicate the issue.

You might want to run 'make --trace' to get a verbose listing to see
what is happening.

Also take a look at the Makedefs file. The relevant definitions I have
does have CXX = clang++ and DSOXX = $(CXX) and LD_CXX = $(CXX). There
are some cxx files in the scheduler/ and ppdc/ directories.

I do note that my build log also has:

Compiling cups-driverd.cxx...
warning: unknown warning option '-Wno-format-truncation'
[-Wunknown-warning-option]

But that didn't break the build for me.

-- Bruce




-- Bruce
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/
Wayne Blaszczyk
2018-06-07 10:04:16 UTC
Permalink
Post by Bruce Dubbs
CC=gcc: This environment variable ensures that gcc is used, if clang is installed. Remove it, if you prefer to use clang. Using clang almost doubles build time and slightly decreases build disk
space. Installed disk space is not appreciably modified.
I found that just having CC=gcc was not enough to get this to correctly build, as for some reason the build would still try using clang to, if I have the term correct, linking, ie using clang
equivalent of g++
This was not my doing. I am just following what is currently listed in svn for the instructions for both systemd version and for sysv of the book.
Christopher.
FWIW, I've been using both CC=gcc CXX=g++ in my Cups build for quite some time, for the very same reason mentioned by Christopher.
Looking back at my history, it was at the time when -DLLVM_LINK_LLVM_DYLIB=ON was added to llvm.
Wayne.
Fri May 11 20:34:12 CDT 2018 /usr/src/llvm/llvm-6.0.0.src.tar.xz
Tue May 15 16:10:10 CDT 2018 /usr/src/cups/cups-2.2.7-source.tar.gz
CC=gcc \
./configure --libdir=/usr/lib \
--disable-systemd \
--with-rcdir=/tmp/cupsinit \
--with-system-groups=lpadmin \
--with-docdir=/usr/share/cups/doc-$VER
For llvm I do have -DLLVM_LINK_LLVM_DYLIB=ON
Using CC=gcc
Using CXX=gcc
In my build directory, there are no .cc or .cpp files.
I cannot duplicate the issue.
You might want to run 'make --trace' to get a verbose listing to see
what is happening.
Also take a look at the Makedefs file. The relevant definitions I have
does have CXX = clang++ and DSOXX = $(CXX) and LD_CXX = $(CXX). There
are some cxx files in the scheduler/ and ppdc/ directories.
Compiling cups-driverd.cxx...
warning: unknown warning option '-Wno-format-truncation'
[-Wunknown-warning-option]
But that didn't break the build for me.
-- Bruce
-- Bruce
I build llvm and clang separately and use slightly different parameters to the book, hence why I didn't report this issue myself.
But looking at the configure script, (and I'm not expert reading these scripts), but to me it looks like if it finds clang++, it will use it rather than g++.
I would be interested in your configure output around this area:

checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for clang++... clang++
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ accepts -g... yes
checking for ranlib... ranlib
checking for ar... /usr/bin/ar
checking for chmod... /bin/chmod


Wayne.
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the
Bruce Dubbs
2018-06-07 14:56:05 UTC
Permalink
Post by Wayne Blaszczyk
I build llvm and clang separately and use slightly different parameters to the book, hence why I didn't report this issue myself.
But looking at the configure script, (and I'm not expert reading these scripts), but to me it looks like if it finds clang++, it will use it rather than g++.
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for clang++... clang++
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ accepts -g... yes
checking for ranlib... ranlib
checking for ar... /usr/bin/ar
checking for chmod... /bin/chmod
Yes, I have the identical sequence on my log.

-- Bruce
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information
Ken Moffat
2018-06-08 17:00:19 UTC
Permalink
Post by Bruce Dubbs
Post by Wayne Blaszczyk
I build llvm and clang separately and use slightly different parameters to the book, hence why I didn't report this issue myself.
But looking at the configure script, (and I'm not expert reading these scripts), but to me it looks like if it finds clang++, it will use it rather than g++.
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for clang++... clang++
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ accepts -g... yes
checking for ranlib... ranlib
checking for ar... /usr/bin/ar
checking for chmod... /bin/chmod
Yes, I have the identical sequence on my log.
As a long-time radeon user, what is in the book works for me too.

My LLVM uses
CC=gcc CXX=g++ \
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DLLVM_ENABLE_FFI=ON \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DLLVM_TARGETS_TO_BUILD="host;AMDGPU" \
-Wno-dev ..

and I do not build cups until after Xorg (but before the gtk
toolkits).

With systemd disabled and just passing CC=gcc to configure, the
output from cups at the start of make is:

config.status: creating config.h
Using ARCHFLAGS=
Using ALL_CFLAGS=-I.. -D_CUPS_SOURCE -O2 -march=native -I/usr/include/libusb-1.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -DDBUS_API_SUBJECT_TO_CHANGE -I/usr/include/p11-kit-1 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT
Using ALL_CXXFLAGS=-I.. -D_CUPS_SOURCE -O2 -march=native -I/usr/include/p11-kit-1 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT
Using CC=gcc
Using CXX=gcc
Using DSOFLAGS=-L../cups -Wl,-soname,all -shared -Wall -Wno-format-y2k -Wunused -fPIC -Os -g -fstack-protector -Wno-unused-result -Wsign-conversion -Wno-tautological-compare -Wno-format-truncation -D_GNU_SOURCE
Using LDFLAGS=-L../cgi-bin -L../cups -L../filter -L../ppdc -L../scheduler -fPIE -pie -Wall -Wno-format-y2k -Wunused -fPIC -Os -g -fstack-protector -Wno-unused-result -Wsign-conversion -Wno-tautological-compare -Wno-format-truncation -D_GNU_SOURCE
Using LIBS=-lcups -lgnutls -lz -lpthread -lm -lcrypt -lz
Making all in cups...

Curious why it doesn't work for you.

ĸen
--
Keyboard not found, Press F1 to continue
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: Se
Christopher Gregory
2018-06-08 20:16:28 UTC
Permalink
Sent: Saturday, June 09, 2018 at 5:00 AM
Subject: Re: [blfs-support] Cups-2.2.7 with clang 6 installed
Post by Bruce Dubbs
Post by Wayne Blaszczyk
I build llvm and clang separately and use slightly different parameters to the book, hence why I didn't report this issue myself.
But looking at the configure script, (and I'm not expert reading these scripts), but to me it looks like if it finds clang++, it will use it rather than g++.
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for clang++... clang++
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ accepts -g... yes
checking for ranlib... ranlib
checking for ar... /usr/bin/ar
checking for chmod... /bin/chmod
Yes, I have the identical sequence on my log.
As a long-time radeon user, what is in the book works for me too.
My LLVM uses
CC=gcc CXX=g++ \
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DLLVM_ENABLE_FFI=ON \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DLLVM_TARGETS_TO_BUILD="host;AMDGPU" \
-Wno-dev ..
and I do not build cups until after Xorg (but before the gtk
toolkits).
With systemd disabled and just passing CC=gcc to configure, the
config.status: creating config.h
Using ARCHFLAGS=
Using ALL_CFLAGS=-I.. -D_CUPS_SOURCE -O2 -march=native -I/usr/include/libusb-1.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -DDBUS_API_SUBJECT_TO_CHANGE -I/usr/include/p11-kit-1 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT
Using ALL_CXXFLAGS=-I.. -D_CUPS_SOURCE -O2 -march=native -I/usr/include/p11-kit-1 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT
Using CC=gcc
Using CXX=gcc
Using DSOFLAGS=-L../cups -Wl,-soname,all -shared -Wall -Wno-format-y2k -Wunused -fPIC -Os -g -fstack-protector -Wno-unused-result -Wsign-conversion -Wno-tautological-compare -Wno-format-truncation -D_GNU_SOURCE
Using LDFLAGS=-L../cgi-bin -L../cups -L../filter -L../ppdc -L../scheduler -fPIE -pie -Wall -Wno-format-y2k -Wunused -fPIC -Os -g -fstack-protector -Wno-unused-result -Wsign-conversion -Wno-tautological-compare -Wno-format-truncation -D_GNU_SOURCE
Using LIBS=-lcups -lgnutls -lz -lpthread -lm -lcrypt -lz
Making all in cups...
Curious why it doesn't work for you.
ĸen
--
Keyboard not found, Press F1 to continue
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page
Hello Ken,

Your not the only one who is curious by this. It makes no sense that giving the exact same tar ball, and using the exact same method of building that two people get exactly the same error.

Wayne, what version of the book are you using? ie is it systemd or sysv? I am just wondering if having systemd installed is some how or other messing things up. I have had to use this CC=gcc CXX=g++ on quite a few packages this time round.

Regards,

Christopher.
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: S
Wayne Blaszczyk
2018-06-09 01:46:41 UTC
Permalink
Post by Christopher Gregory
Sent: Saturday, June 09, 2018 at 5:00 AM
Subject: Re: [blfs-support] Cups-2.2.7 with clang 6 installed
Post by Bruce Dubbs
Post by Wayne Blaszczyk
I build llvm and clang separately and use slightly different parameters to the book, hence why I didn't report this issue myself.
But looking at the configure script, (and I'm not expert reading these scripts), but to me it looks like if it finds clang++, it will use it rather than g++.
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for clang++... clang++
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ accepts -g... yes
checking for ranlib... ranlib
checking for ar... /usr/bin/ar
checking for chmod... /bin/chmod
Yes, I have the identical sequence on my log.
As a long-time radeon user, what is in the book works for me too.
My LLVM uses
CC=gcc CXX=g++ \
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DLLVM_ENABLE_FFI=ON \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DLLVM_TARGETS_TO_BUILD="host;AMDGPU" \
-Wno-dev ..
and I do not build cups until after Xorg (but before the gtk
toolkits).
With systemd disabled and just passing CC=gcc to configure, the
config.status: creating config.h
Using ARCHFLAGS=
Using ALL_CFLAGS=-I.. -D_CUPS_SOURCE -O2 -march=native -I/usr/include/libusb-1.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -DDBUS_API_SUBJECT_TO_CHANGE -I/usr/include/p11-kit-1
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT
Using ALL_CXXFLAGS=-I.. -D_CUPS_SOURCE -O2 -march=native -I/usr/include/p11-kit-1 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT
Using CC=gcc
Using CXX=gcc
Using DSOFLAGS=-L../cups -Wl,-soname,all -shared -Wall -Wno-format-y2k -Wunused -fPIC -Os -g -fstack-protector -Wno-unused-result -Wsign-conversion -Wno-tautological-compare -Wno-format-
truncation -D_GNU_SOURCE
Using LDFLAGS=-L../cgi-bin -L../cups -L../filter -L../ppdc -L../scheduler -fPIE -pie -Wall -Wno-format-y2k -Wunused -fPIC -Os -g -fstack-protector -Wno-unused-result -Wsign-conversion -Wno-
tautological-compare -Wno-format-truncation -D_GNU_SOURCE
Using LIBS=-lcups -lgnutls -lz -lpthread -lm -lcrypt -lz
Making all in cups...
Curious why it doesn't work for you.
ĸen
--
Keyboard not found, Press F1 to continue
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page
Hello Ken,
Your not the only one who is curious by this. It makes no sense that giving the exact same tar ball, and using the exact same method of building that two people get exactly the same error.
Wayne, what version of the book are you using? ie is it systemd or sysv? I am just wondering if having systemd installed is some how or other messing things up. I have had to use this CC=gcc
CXX=g++ on quite a few packages this time round.
Regards,
Christopher.
I used systemd.

My LLVM build uses the following:

CC=gcc CXX=g++ \
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DLLVM_ENABLE_FFI=ON \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_TARGETS_TO_BUILD="host" \
-Wno-dev \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DCMAKE_SHARED_LINKER_FLAGS="-Wl,-Bsymbolic" \
..

My clang build uses the following:

CC=gcc CXX=g++ \
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DLLVM_CONFIG=/usr/bin/llvm-config \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_LINK_LLVM_DYLIB=ON \
-Wno-dev \
..

I do not build the Compiler RT.

The reason why I made these changes at the time was,
1) I like to separate out builds into there individual packages.
2) I wanted to get rid of the LDFLAGS=-lLLVM from the mesa build due to llvm being linked to every binary even if it was not needed.

Going back to the cups build, I added few echo commands into configure:

3480 if test -n "$CCC"; then
3481 CXX=$CCC
3482 echo FRED3: $CXX
3483 else
3484 if test -n "$ac_tool_prefix"; then
...
3570
3571 if test "x$ac_ct_CXX" = x; then
3572 CXX="g++"
3573 echo FRED1: $CXX
3574 else
3575 case $cross_compiling:$ac_tool_warned in
3576 yes:)
3577 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host tr iplet" >&5
3578 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3579 ac_tool_warned=yes ;;
3580 esac
3581 CXX=$ac_ct_CXX
3582 echo FRED2: $CXX
3583 fi
3584 fi
3585
...
11703 chmod +x cups-config
11704 echo FRED4: $CXX


Running
wblaszcz [ /sources/cups-2.2.7 ]$ ./configure |grep FRED
FRED2: clang++
FRED4: clang++
wblaszcz [ /sources/cups-2.2.7 ]$ CC=gcc ./configure |grep FRED
FRED2: clang++
FRED4: clang++
wblaszcz [ /sources/cups-2.2.7 ]$ CC=gcc CXX=g++ ./configure |grep FRED
FRED4: g++
wblaszcz [ /sources/cups-2.2.7 ]$

Regards,
Wayne.
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See th
Wayne Blaszczyk
2018-06-09 23:54:49 UTC
Permalink
Post by Christopher Gregory
Sent: Saturday, June 09, 2018 at 5:00 AM
Subject: Re: [blfs-support] Cups-2.2.7 with clang 6 installed
Post by Bruce Dubbs
Post by Wayne Blaszczyk
I build llvm and clang separately and use slightly different parameters to the book, hence why I didn't report this issue myself.
But looking at the configure script, (and I'm not expert reading these scripts), but to me it looks like if it finds clang++, it will use it rather than g++.
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for clang++... clang++
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ accepts -g... yes
checking for ranlib... ranlib
checking for ar... /usr/bin/ar
checking for chmod... /bin/chmod
Yes, I have the identical sequence on my log.
As a long-time radeon user, what is in the book works for me too.
My LLVM uses
CC=gcc CXX=g++ \
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DLLVM_ENABLE_FFI=ON \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DLLVM_TARGETS_TO_BUILD="host;AMDGPU" \
-Wno-dev ..
and I do not build cups until after Xorg (but before the gtk
toolkits).
With systemd disabled and just passing CC=gcc to configure, the
config.status: creating config.h
Using ARCHFLAGS=
Using ALL_CFLAGS=-I.. -D_CUPS_SOURCE -O2 -march=native -I/usr/include/libusb-1.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -DDBUS_API_SUBJECT_TO_CHANGE -I/usr/include/p11-kit-1
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT
Using ALL_CXXFLAGS=-I.. -D_CUPS_SOURCE -O2 -march=native -I/usr/include/p11-kit-1 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT
Using CC=gcc
Using CXX=gcc
Using DSOFLAGS=-L../cups -Wl,-soname,all -shared -Wall -Wno-format-y2k -Wunused -fPIC -Os -g -fstack-protector -Wno-unused-result -Wsign-conversion -Wno-tautological-compare -Wno-format-
truncation -D_GNU_SOURCE
Using LDFLAGS=-L../cgi-bin -L../cups -L../filter -L../ppdc -L../scheduler -fPIE -pie -Wall -Wno-format-y2k -Wunused -fPIC -Os -g -fstack-protector -Wno-unused-result -Wsign-conversion -Wno-
tautological-compare -Wno-format-truncation -D_GNU_SOURCE
Using LIBS=-lcups -lgnutls -lz -lpthread -lm -lcrypt -lz
Making all in cups...
Curious why it doesn't work for you.
ĸen
--
Keyboard not found, Press F1 to continue
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page
Hello Ken,
Your not the only one who is curious by this. It makes no sense that giving the exact same tar ball, and using the exact same method of building that two people get exactly the same error.
Wayne, what version of the book are you using? ie is it systemd or sysv? I am just wondering if having systemd installed is some how or other messing things up. I have had to use this CC=gcc
CXX=g++ on quite a few packages this time round.
Regards,
Christopher.
Hi Christopher,

You mentioned you need to do on other packages. Can you list them please.
I did a quick search and found that icu is another package I had to specify CC=gcc CXX=g++.
Looking at my commit history, I added this on the 7th April. Looking at that (weekly) build and the previous build, I can see the build order had changed. icu was built after llvm/clang whereas the
previous build icu was build before llvm/clang. There were no other changes to package versions between the two builds that I could see that would have impacted this.

Regards,
Wayne.
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the abo
Wayne Blaszczyk
2018-06-10 02:00:11 UTC
Permalink
Post by Wayne Blaszczyk
Post by Christopher Gregory
Sent: Saturday, June 09, 2018 at 5:00 AM
Subject: Re: [blfs-support] Cups-2.2.7 with clang 6 installed
Post by Bruce Dubbs
Post by Wayne Blaszczyk
I build llvm and clang separately and use slightly different parameters to the book, hence why I didn't report this issue myself.
But looking at the configure script, (and I'm not expert reading these scripts), but to me it looks like if it finds clang++, it will use it rather than g++.
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for clang++... clang++
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ accepts -g... yes
checking for ranlib... ranlib
checking for ar... /usr/bin/ar
checking for chmod... /bin/chmod
Yes, I have the identical sequence on my log.
As a long-time radeon user, what is in the book works for me too.
My LLVM uses
CC=gcc CXX=g++ \
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DLLVM_ENABLE_FFI=ON \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DLLVM_TARGETS_TO_BUILD="host;AMDGPU" \
-Wno-dev ..
and I do not build cups until after Xorg (but before the gtk
toolkits).
With systemd disabled and just passing CC=gcc to configure, the
config.status: creating config.h
Using ARCHFLAGS=
Using ALL_CFLAGS=-I.. -D_CUPS_SOURCE -O2 -march=native -I/usr/include/libusb-1.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -DDBUS_API_SUBJECT_TO_CHANGE -I/usr/include/p11-kit-1
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT
Using ALL_CXXFLAGS=-I.. -D_CUPS_SOURCE -O2 -march=native -I/usr/include/p11-kit-1 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT
Using CC=gcc
Using CXX=gcc
Using DSOFLAGS=-L../cups -Wl,-soname,all -shared -Wall -Wno-format-y2k -Wunused -fPIC -Os -g -fstack-protector -Wno-unused-result -Wsign-conversion -Wno-tautological-compare -Wno-format-
truncation -D_GNU_SOURCE
Using LDFLAGS=-L../cgi-bin -L../cups -L../filter -L../ppdc -L../scheduler -fPIE -pie -Wall -Wno-format-y2k -Wunused -fPIC -Os -g -fstack-protector -Wno-unused-result -Wsign-conversion -Wno-
tautological-compare -Wno-format-truncation -D_GNU_SOURCE
Using LIBS=-lcups -lgnutls -lz -lpthread -lm -lcrypt -lz
Making all in cups...
Curious why it doesn't work for you.
ĸen
--
Keyboard not found, Press F1 to continue
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page
Hello Ken,
Your not the only one who is curious by this. It makes no sense that giving the exact same tar ball, and using the exact same method of building that two people get exactly the same error.
Wayne, what version of the book are you using? ie is it systemd or sysv? I am just wondering if having systemd installed is some how or other messing things up. I have had to use this CC=gcc
CXX=g++ on quite a few packages this time round.
Regards,
Christopher.
Hi Christopher,
You mentioned you need to do on other packages. Can you list them please.
I did a quick search and found that icu is another package I had to specify CC=gcc CXX=g++.
Looking at my commit history, I added this on the 7th April. Looking at that (weekly) build and the previous build, I can see the build order had changed. icu was built after llvm/clang whereas the
previous build icu was build before llvm/clang. There were no other changes to package versions between the two builds that I could see that would have impacted this.
Regards,
Wayne.
I've narrowed down the issue with building icu.
The build failure is due to the clang++ test.
The test is compiling conftest.cpp .
====
/* confdefs.h */
#define PACKAGE_NAME "ICU"
#define PACKAGE_TARNAME "International Components for Unicode"
#define PACKAGE_VERSION "61.1"
#define PACKAGE_STRING "ICU 61.1"
#define PACKAGE_BUGREPORT "http://icu-project.org/bugs"
#define PACKAGE_URL "http://icu-project.org"
#define SIZEOF_VOID_P 0
/* end confdefs.h. */

int
main ()
{

;
return 0;
}
====

clang++ -c -O2 -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long conftest.cpp

This causes a stack dump.
By removing the -O2 parameter fixes this issue.

wblaszcz [ ~/tmp/clangTest ]$ clang++ -c -O2 -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long conftest.cpp
#0 0x0000000001409f6a llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/bin/clang-6.0+0x1409f6a)
#1 0x0000000001407fa6 llvm::sys::RunSignalHandlers() (/usr/bin/clang-6.0+0x1407fa6)
#2 0x00000000014080d8 SignalHandler(int) (/usr/bin/clang-6.0+0x14080d8)
#3 0x00007f5aceb7cf10 __restore_rt (/lib/libpthread.so.0+0x11f10)
#4 0x0000000000f60f15 llvm::PMTopLevelManager::addImmutablePass(llvm::ImmutablePass*) (/usr/bin/clang-6.0+0xf60f15)
#5 0x0000000000f62d9a llvm::PMTopLevelManager::schedulePass(llvm::Pass*) (/usr/bin/clang-6.0+0xf62d9a)
#6 0x00007f5accdfe4a2 llvm::PassManagerBuilder::addInitialAliasAnalysisPasses(llvm::legacy::PassManagerBase&) const (/usr/bin/../lib/libLLVM-6.0.so+0x119c4a2)
#7 0x00007f5accdfe5c6 llvm::PassManagerBuilder::populateFunctionPassManager(llvm::legacy::FunctionPassManager&) (/usr/bin/../lib/libLLVM-6.0.so+0x119c5c6)
#8 0x00000000015f0219 (anonymous namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >)
(/usr/bin/clang-6.0+0x15f0219)
#9 0x00000000015f2245 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&,
llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (/usr/bin/clang-6.0+0x15f2245)
#10 0x0000000001ef5e7f clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/usr/bin/clang-6.0+0x1ef5e7f)
#11 0x00000000021bc76a clang::ParseAST(clang::Sema&, bool, bool) (/usr/bin/clang-6.0+0x21bc76a)
#12 0x0000000001ef4e71 clang::CodeGenAction::ExecuteAction() (/usr/bin/clang-6.0+0x1ef4e71)
#13 0x00000000019d65b6 clang::FrontendAction::Execute() (/usr/bin/clang-6.0+0x19d65b6)
#14 0x000000000199f3cc clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/bin/clang-6.0+0x199f3cc)
#15 0x0000000001a886fb clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/bin/clang-6.0+0x1a886fb)
#16 0x00000000007cc118 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/bin/clang-6.0+0x7cc118)
#17 0x0000000000788ff5 main (/usr/bin/clang-6.0+0x788ff5)
#18 0x00007f5acaf98a57 __libc_start_main /opt/wbBuild/var/sources/glibc-2.27/csu/../csu/libc-start.c:342:0
#19 0x00000000007c992a _start /opt/wbBuild/var/sources/glibc-2.27/csu/../sysdeps/x86_64/start.S:122:0
Stack dump:
0. Program arguments: /usr/bin/clang-6.0 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name conftest.cpp -mrelocation-
model static -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer
-coverage-notes-file /home/wblaszcz/tmp/clangTest/conftest.gcno -resource-dir /usr/lib/clang/6.0.0 -internal-isystem /usr/bin/../lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0
-internal-isystem /usr/bin/../lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/x86_64-pc-linux-gnu -internal-isystem /usr/bin/../lib/gcc/x86_64-pc-linux-
gnu/7.3.0/../../../../include/c++/7.3.0/backward -internal-isystem /usr/local/include -internal-isystem /usr/lib/clang/6.0.0/include -internal-externc-isystem /include -internal-externc-isystem
/usr/include -O2 -W -Wall -Wpointer-arith -Wwrite-strings -Wno-long-long -pedantic -fdeprecated-macro -fdebug-compilation-dir /home/wblaszcz/tmp/clangTest -ferror-limit 19 -fmessage-length 169 -fobjc-
runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o conftest.o -x c++ conftest.cpp
1. <eof> parser at end of file
clang-6.0: error: unable to execute command: Segmentation fault (core dumped)
clang-6.0: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 6.0.0 (tags/RELEASE_600/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang-6.0: note: diagnostic msg: PLEASE submit a bug report to and include the crash backtrace, preprocessed source, and associated run script.
clang-6.0: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-6.0: note: diagnostic msg: /tmp/conftest-92489a.cpp
clang-6.0: note: diagnostic msg: /tmp/conftest-92489a.sh
clang-6.0: note: diagnostic msg:

********************
wblaszcz [ ~/tmp/clangTest ]$ clang++ -c -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long conftest.cpp
wblaszcz [ ~/tmp/clangTest ]$

So the question is, why is clang++ failing with the -O2 option.
As mentioned before, my llvm/clang build is different to the book.
And I do not have any issues with building rust, mesa, or firefox.

Stepping back a bit, the bottom line is that if CC=gcc and/or CXX=g++ is not specified, then cups and icu will use clang instead of gcc if available.
Something that should be mentioned in the book?

Regards,

Regards,
Wayne
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page
Wayne Blaszczyk
2018-06-13 12:16:50 UTC
Permalink
Post by Wayne Blaszczyk
Post by Christopher Gregory
Sent: Saturday, June 09, 2018 at 5:00 AM
Subject: Re: [blfs-support] Cups-2.2.7 with clang 6 installed
Post by Bruce Dubbs
Post by Wayne Blaszczyk
I build llvm and clang separately and use slightly different parameters to the book, hence why I didn't report this issue myself.
But looking at the configure script, (and I'm not expert reading these scripts), but to me it looks like if it finds clang++, it will use it rather than g++.
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for clang++... clang++
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ accepts -g... yes
checking for ranlib... ranlib
checking for ar... /usr/bin/ar
checking for chmod... /bin/chmod
Yes, I have the identical sequence on my log.
As a long-time radeon user, what is in the book works for me too.
My LLVM uses
CC=gcc CXX=g++ \
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DLLVM_ENABLE_FFI=ON \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DLLVM_TARGETS_TO_BUILD="host;AMDGPU" \
-Wno-dev ..
and I do not build cups until after Xorg (but before the gtk
toolkits).
With systemd disabled and just passing CC=gcc to configure, the
config.status: creating config.h
Using ARCHFLAGS=
Using ALL_CFLAGS=-I.. -D_CUPS_SOURCE -O2 -march=native -I/usr/include/libusb-1.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -DDBUS_API_SUBJECT_TO_CHANGE -I/usr/include/p11-kit-1
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT
Using ALL_CXXFLAGS=-I.. -D_CUPS_SOURCE -O2 -march=native -I/usr/include/p11-kit-1 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT
Using CC=gcc
Using CXX=gcc
Using DSOFLAGS=-L../cups -Wl,-soname,all -shared -Wall -Wno-format-y2k -Wunused -fPIC -Os -g -fstack-protector -Wno-unused-result -Wsign-conversion -Wno-tautological-compare -Wno-format-
truncation -D_GNU_SOURCE
Using LDFLAGS=-L../cgi-bin -L../cups -L../filter -L../ppdc -L../scheduler -fPIE -pie -Wall -Wno-format-y2k -Wunused -fPIC -Os -g -fstack-protector -Wno-unused-result -Wsign-conversion -Wno-
tautological-compare -Wno-format-truncation -D_GNU_SOURCE
Using LIBS=-lcups -lgnutls -lz -lpthread -lm -lcrypt -lz
Making all in cups...
Curious why it doesn't work for you.
ĸen
--
Keyboard not found, Press F1 to continue
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page
Hello Ken,
Your not the only one who is curious by this. It makes no sense that giving the exact same tar ball, and using the exact same method of building that two people get exactly the same error.
Wayne, what version of the book are you using? ie is it systemd or sysv? I am just wondering if having systemd installed is some how or other messing things up. I have had to use this
CC=gcc
CXX=g++ on quite a few packages this time round.
Regards,
Christopher.
I've narrowed down the issue with building icu.
The build failure is due to the clang++ test.
The test is compiling conftest.cpp .
clang++ -c -O2 -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long conftest.cpp
This causes a stack dump.
By removing the -O2 parameter fixes this issue.
wblaszcz [ ~/tmp/clangTest ]$ clang++ -c -O2 -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long conftest.cpp
#0 0x0000000001409f6a llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/bin/clang-6.0+0x1409f6a)
#1 0x0000000001407fa6 llvm::sys::RunSignalHandlers() (/usr/bin/clang-6.0+0x1407fa6)
#2 0x00000000014080d8 SignalHandler(int) (/usr/bin/clang-6.0+0x14080d8)
#3 0x00007f5aceb7cf10 __restore_rt (/lib/libpthread.so.0+0x11f10)
#4 0x0000000000f60f15 llvm::PMTopLevelManager::addImmutablePass(llvm::ImmutablePass*) (/usr/bin/clang-6.0+0xf60f15)
#5 0x0000000000f62d9a llvm::PMTopLevelManager::schedulePass(llvm::Pass*) (/usr/bin/clang-6.0+0xf62d9a)
#6 0x00007f5accdfe4a2 llvm::PassManagerBuilder::addInitialAliasAnalysisPasses(llvm::legacy::PassManagerBase&) const (/usr/bin/../lib/libLLVM-6.0.so+0x119c4a2)
#7 0x00007f5accdfe5c6 llvm::PassManagerBuilder::populateFunctionPassManager(llvm::legacy::FunctionPassManager&) (/usr/bin/../lib/libLLVM-6.0.so+0x119c5c6)
#8 0x00000000015f0219 (anonymous namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >)
(/usr/bin/clang-6.0+0x15f0219)
#9 0x00000000015f2245 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&,
llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (/usr/bin/clang-6.0+0x15f2245)
#10 0x0000000001ef5e7f clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/usr/bin/clang-6.0+0x1ef5e7f)
#11 0x00000000021bc76a clang::ParseAST(clang::Sema&, bool, bool) (/usr/bin/clang-6.0+0x21bc76a)
#12 0x0000000001ef4e71 clang::CodeGenAction::ExecuteAction() (/usr/bin/clang-6.0+0x1ef4e71)
#13 0x00000000019d65b6 clang::FrontendAction::Execute() (/usr/bin/clang-6.0+0x19d65b6)
#14 0x000000000199f3cc clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/bin/clang-6.0+0x199f3cc)
#15 0x0000000001a886fb clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/bin/clang-6.0+0x1a886fb)
#16 0x00000000007cc118 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/bin/clang-6.0+0x7cc118)
#17 0x0000000000788ff5 main (/usr/bin/clang-6.0+0x788ff5)
#18 0x00007f5acaf98a57 __libc_start_main /opt/wbBuild/var/sources/glibc-2.27/csu/../csu/libc-start.c:342:0
#19 0x00000000007c992a _start /opt/wbBuild/var/sources/glibc-2.27/csu/../sysdeps/x86_64/start.S:122:0
0. Program arguments: /usr/bin/clang-6.0 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name conftest.cpp -mrelocation-
model static -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-
pointer
-coverage-notes-file /home/wblaszcz/tmp/clangTest/conftest.gcno -resource-dir /usr/lib/clang/6.0.0 -internal-isystem /usr/bin/../lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0
-internal-isystem /usr/bin/../lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/x86_64-pc-linux-gnu -internal-isystem /usr/bin/../lib/gcc/x86_64-pc-linux-
gnu/7.3.0/../../../../include/c++/7.3.0/backward -internal-isystem /usr/local/include -internal-isystem /usr/lib/clang/6.0.0/include -internal-externc-isystem /include -internal-externc-isystem
/usr/include -O2 -W -Wall -Wpointer-arith -Wwrite-strings -Wno-long-long -pedantic -fdeprecated-macro -fdebug-compilation-dir /home/wblaszcz/tmp/clangTest -ferror-limit 19 -fmessage-length 169
-fobjc-
runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o conftest.o -x c++ conftest.cpp
1. <eof> parser at end of file
clang-6.0: error: unable to execute command: Segmentation fault (core dumped)
clang-6.0: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 6.0.0 (tags/RELEASE_600/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang-6.0: note: diagnostic msg: PLEASE submit a bug report to and include the crash backtrace, preprocessed source, and associated run script.
********************
So the question is, why is clang++ failing with the -O2 option.
As mentioned before, my llvm/clang build is different to the book.
And I do not have any issues with building rust, mesa, or firefox.
Stepping back a bit, the bottom line is that if CC=gcc and/or CXX=g++ is not specified, then cups and icu will use clang instead of gcc if available.
Something that should be mentioned in the book?
Regards,
Regards,
Wayne
Hi All,

I've fixed my clang issue.
I first removed -DCMAKE_SHARED_LINKER_FLAGS="-Wl,-Bsymbolic" from my llvm build.
This did not fix anything, but in fact it broke my firefox build.
After a bit of digging around, I notice that Fedora, Arch, and Gentoo had a lot of patches applied to their llvm builds, so I decided to patch as per the Arch build.
So my cmake for llvm is now:
cmake \
CC=gcc CXX=g++ \
-DCMAKE_INSTALL_PREFIX=/usr \
-DLLVM_ENABLE_FFI=ON \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DLLVM_TARGETS_TO_BUILD="host" \
-Wno-dev \
..
and I've applied the following patches:

patch -Np1 -i ../PR35947-export-LLVMInitializeInstCombine-as-extern-C.patch
patch -Np1 -i ../PR36417-DebugInfo-discard-invalid-DBG_VALUE-instructions.patch
patch -Np1 -i ../PR36417-fixup-for-rL326769-RegState-Debug-is-being-truncated.patch
patch -Np1 -i ../D44391-export-LLVM_DYLIB_COMPONENTS-in-LLVMConfig.cmake.patch
patch -Np0 -i ../D44420-cmake-fix-a-typo-in-llvm_config-macro.patch

See https://git.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/llvm

So now I can build icu without CC=gcc CXX=g++
I can build cups without CC=gcc CXX=g++ (just to make it clear, It builds without CC=gcc)
and firefox builds as it used to.

Although, icu and cups still uses clang in preference to gcc.
I hope this helps others.

As a side note, Arch uses ninja for their llvm build, something which I have not tried out myself.

Regards,
Wayne.
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information
Christopher Gregory
2018-06-18 01:10:30 UTC
Permalink
Sent: Thursday, June 14, 2018 at 12:16 AM
Subject: Re: [blfs-support] Cups-2.2.7 with clang 6 installed
Post by Wayne Blaszczyk
Post by Christopher Gregory
Sent: Saturday, June 09, 2018 at 5:00 AM
Subject: Re: [blfs-support] Cups-2.2.7 with clang 6 installed
Post by Bruce Dubbs
Post by Wayne Blaszczyk
I build llvm and clang separately and use slightly different parameters to the book, hence why I didn't report this issue myself.
But looking at the configure script, (and I'm not expert reading these scripts), but to me it looks like if it finds clang++, it will use it rather than g++.
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for clang++... clang++
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ accepts -g... yes
checking for ranlib... ranlib
checking for ar... /usr/bin/ar
checking for chmod... /bin/chmod
Yes, I have the identical sequence on my log.
As a long-time radeon user, what is in the book works for me too.
My LLVM uses
CC=gcc CXX=g++ \
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DLLVM_ENABLE_FFI=ON \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DLLVM_TARGETS_TO_BUILD="host;AMDGPU" \
-Wno-dev ..
and I do not build cups until after Xorg (but before the gtk
toolkits).
With systemd disabled and just passing CC=gcc to configure, the
config.status: creating config.h
Using ARCHFLAGS=
Using ALL_CFLAGS=-I.. -D_CUPS_SOURCE -O2 -march=native -I/usr/include/libusb-1.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -DDBUS_API_SUBJECT_TO_CHANGE -I/usr/include/p11-kit-1
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT
Using ALL_CXXFLAGS=-I.. -D_CUPS_SOURCE -O2 -march=native -I/usr/include/p11-kit-1 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT
Using CC=gcc
Using CXX=gcc
Using DSOFLAGS=-L../cups -Wl,-soname,all -shared -Wall -Wno-format-y2k -Wunused -fPIC -Os -g -fstack-protector -Wno-unused-result -Wsign-conversion -Wno-tautological-compare -Wno-format-
truncation -D_GNU_SOURCE
Using LDFLAGS=-L../cgi-bin -L../cups -L../filter -L../ppdc -L../scheduler -fPIE -pie -Wall -Wno-format-y2k -Wunused -fPIC -Os -g -fstack-protector -Wno-unused-result -Wsign-conversion -Wno-
tautological-compare -Wno-format-truncation -D_GNU_SOURCE
Using LIBS=-lcups -lgnutls -lz -lpthread -lm -lcrypt -lz
Making all in cups...
Curious why it doesn't work for you.
ĸen
--
Keyboard not found, Press F1 to continue
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page
Hello Ken,
Your not the only one who is curious by this. It makes no sense that giving the exact same tar ball, and using the exact same method of building that two people get exactly the same error.
Wayne, what version of the book are you using? ie is it systemd or sysv? I am just wondering if having systemd installed is some how or other messing things up. I have had to use this
CC=gcc
CXX=g++ on quite a few packages this time round.
Regards,
Christopher.
I've narrowed down the issue with building icu.
The build failure is due to the clang++ test.
The test is compiling conftest.cpp .
clang++ -c -O2 -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long conftest.cpp
This causes a stack dump.
By removing the -O2 parameter fixes this issue.
wblaszcz [ ~/tmp/clangTest ]$ clang++ -c -O2 -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long conftest.cpp
#0 0x0000000001409f6a llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/bin/clang-6.0+0x1409f6a)
#1 0x0000000001407fa6 llvm::sys::RunSignalHandlers() (/usr/bin/clang-6.0+0x1407fa6)
#2 0x00000000014080d8 SignalHandler(int) (/usr/bin/clang-6.0+0x14080d8)
#3 0x00007f5aceb7cf10 __restore_rt (/lib/libpthread.so.0+0x11f10)
#4 0x0000000000f60f15 llvm::PMTopLevelManager::addImmutablePass(llvm::ImmutablePass*) (/usr/bin/clang-6.0+0xf60f15)
#5 0x0000000000f62d9a llvm::PMTopLevelManager::schedulePass(llvm::Pass*) (/usr/bin/clang-6.0+0xf62d9a)
#6 0x00007f5accdfe4a2 llvm::PassManagerBuilder::addInitialAliasAnalysisPasses(llvm::legacy::PassManagerBase&) const (/usr/bin/../lib/libLLVM-6.0.so+0x119c4a2)
#7 0x00007f5accdfe5c6 llvm::PassManagerBuilder::populateFunctionPassManager(llvm::legacy::FunctionPassManager&) (/usr/bin/../lib/libLLVM-6.0.so+0x119c5c6)
#8 0x00000000015f0219 (anonymous namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >)
(/usr/bin/clang-6.0+0x15f0219)
#9 0x00000000015f2245 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&,
llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (/usr/bin/clang-6.0+0x15f2245)
#10 0x0000000001ef5e7f clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/usr/bin/clang-6.0+0x1ef5e7f)
#11 0x00000000021bc76a clang::ParseAST(clang::Sema&, bool, bool) (/usr/bin/clang-6.0+0x21bc76a)
#12 0x0000000001ef4e71 clang::CodeGenAction::ExecuteAction() (/usr/bin/clang-6.0+0x1ef4e71)
#13 0x00000000019d65b6 clang::FrontendAction::Execute() (/usr/bin/clang-6.0+0x19d65b6)
#14 0x000000000199f3cc clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/bin/clang-6.0+0x199f3cc)
#15 0x0000000001a886fb clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/bin/clang-6.0+0x1a886fb)
#16 0x00000000007cc118 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/bin/clang-6.0+0x7cc118)
#17 0x0000000000788ff5 main (/usr/bin/clang-6.0+0x788ff5)
#18 0x00007f5acaf98a57 __libc_start_main /opt/wbBuild/var/sources/glibc-2.27/csu/../csu/libc-start.c:342:0
#19 0x00000000007c992a _start /opt/wbBuild/var/sources/glibc-2.27/csu/../sysdeps/x86_64/start.S:122:0
0. Program arguments: /usr/bin/clang-6.0 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name conftest.cpp -mrelocation-
model static -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-
pointer
-coverage-notes-file /home/wblaszcz/tmp/clangTest/conftest.gcno -resource-dir /usr/lib/clang/6.0.0 -internal-isystem /usr/bin/../lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0
-internal-isystem /usr/bin/../lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/x86_64-pc-linux-gnu -internal-isystem /usr/bin/../lib/gcc/x86_64-pc-linux-
gnu/7.3.0/../../../../include/c++/7.3.0/backward -internal-isystem /usr/local/include -internal-isystem /usr/lib/clang/6.0.0/include -internal-externc-isystem /include -internal-externc-isystem
/usr/include -O2 -W -Wall -Wpointer-arith -Wwrite-strings -Wno-long-long -pedantic -fdeprecated-macro -fdebug-compilation-dir /home/wblaszcz/tmp/clangTest -ferror-limit 19 -fmessage-length 169
-fobjc-
runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o conftest.o -x c++ conftest.cpp
1. <eof> parser at end of file
clang-6.0: error: unable to execute command: Segmentation fault (core dumped)
clang-6.0: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 6.0.0 (tags/RELEASE_600/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang-6.0: note: diagnostic msg: PLEASE submit a bug report to and include the crash backtrace, preprocessed source, and associated run script.
********************
So the question is, why is clang++ failing with the -O2 option.
As mentioned before, my llvm/clang build is different to the book.
And I do not have any issues with building rust, mesa, or firefox.
Stepping back a bit, the bottom line is that if CC=gcc and/or CXX=g++ is not specified, then cups and icu will use clang instead of gcc if available.
Something that should be mentioned in the book?
Regards,
Regards,
Wayne
Hi All,
I've fixed my clang issue.
I first removed -DCMAKE_SHARED_LINKER_FLAGS="-Wl,-Bsymbolic" from my llvm build.
This did not fix anything, but in fact it broke my firefox build.
After a bit of digging around, I notice that Fedora, Arch, and Gentoo had a lot of patches applied to their llvm builds, so I decided to patch as per the Arch build.
cmake \
CC=gcc CXX=g++ \
-DCMAKE_INSTALL_PREFIX=/usr \
-DLLVM_ENABLE_FFI=ON \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DLLVM_TARGETS_TO_BUILD="host" \
-Wno-dev \
..
patch -Np1 -i ../PR35947-export-LLVMInitializeInstCombine-as-extern-C.patch
patch -Np1 -i ../PR36417-DebugInfo-discard-invalid-DBG_VALUE-instructions.patch
patch -Np1 -i ../PR36417-fixup-for-rL326769-RegState-Debug-is-being-truncated.patch
patch -Np1 -i ../D44391-export-LLVM_DYLIB_COMPONENTS-in-LLVMConfig.cmake.patch
patch -Np0 -i ../D44420-cmake-fix-a-typo-in-llvm_config-macro.patch
See https://git.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/llvm
So now I can build icu without CC=gcc CXX=g++
I can build cups without CC=gcc CXX=g++ (just to make it clear, It builds without CC=gcc)
and firefox builds as it used to.
Although, icu and cups still uses clang in preference to gcc.
I hope this helps others.
As a side note, Arch uses ninja for their llvm build, something which I have not tried out myself.
Regards,
Wayne.
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page
Well I too solved the issues. Not that anyone maintaining the book cares as it does not happen to THEM, but the easy fix and solution for me was to build the whole of llvm, clang and rt with make -j1. I do not care what the people with puffed up self-importance say, there is a RACE condition that occurs on SOME machines. Yes Wayne fixed the issue with patches and modified instructions from arch, but even arch are skirting round things. With my complete build notes, after I have completed this installation and made sure that none of the other packages that needed CC=gcc CXX=g++ require that any more, I will do another fresh installation using my notes and if it builds correctly again, I will know the reason that it failed was incomplete/inaccurate instructions on the LLVM page.

Christopher.
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the a
Loading...