SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi, I'm on current with multilib and i need to downgrade llvm to 3.9 to be able to compile an older mesa.
My need for older mesa is to trace if there is a regression on my hardware.
I compiled llvm 3.9.1 as 64bit with no problems at all but i can't seem to compile a 32bit version without errors.
-- Check for working C compiler: /usr/bin/32/clang
-- Check for working C compiler: /usr/bin/32/clang -- broken
CMake Error at /usr/share/cmake-3.7/Modules/CMakeTestCCompiler.cmake:51 (message):
The C compiler "/usr/bin/32/clang" is not able to compile a simple test
program.
It fails with the following output:
Change Dir: /tmp/llvm-3.9.1.src/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/gmake" "cmTC_be965/fast"
/usr/bin/gmake -f CMakeFiles/cmTC_be965.dir/build.make
CMakeFiles/cmTC_be965.dir/build
gmake[1]: Entering directory
'/tmp/llvm-3.9.1.src/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_be965.dir/testCCompiler.c.o
/usr/bin/32/clang -O2 -march=i586 -mtune=i686 -o
CMakeFiles/cmTC_be965.dir/testCCompiler.c.o -c
/tmp/llvm-3.9.1.src/build/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_be965
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_be965.dir/link.txt
--verbose=1
/usr/bin/32/clang -O2 -march=i586 -mtune=i686
CMakeFiles/cmTC_be965.dir/testCCompiler.c.o -o cmTC_be965
/usr/bin/ld: skipping incompatible
/usr/lib64/gcc/x86_64-slackware-linux/5.4.0/../../../libgcc_s.so when
searching for -lgcc_s
/usr/bin/ld: skipping incompatible
/usr/lib64/gcc/x86_64-slackware-linux/5.4.0/../../../libc.so when searching
for -lc
/usr/bin/ld: skipping incompatible
/usr/lib64/gcc/x86_64-slackware-linux/5.4.0/../../../libc.a when searching
for -lc
/lib/libc.so.6: error adding symbols: File format not recognized
clang-4.0-32: error: linker command failed with exit code 1 (use -v to see
invocation)
gmake[1]: *** [CMakeFiles/cmTC_be965.dir/build.make:98: cmTC_be965] Error 1
gmake[1]: Leaving directory '/tmp/llvm-3.9.1.src/build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:126: cmTC_be965/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:48 (project)
-- Configuring incomplete, errors occurred!
See also "/tmp/llvm-3.9.1.src/build/CMakeFiles/CMakeOutput.log".
See also "/tmp/llvm-3.9.1.src/build/CMakeFiles/CMakeError.log".
So it seems that it reports that clang is broken and can't compile a simple test.
What do i have to do to compile an 32-bit llvm 3.9.1 on current with multilib?
What mesa GL driver are you using? I think unless you have an amdgpu where llvm is needed or are bisecting the llvmpipe its probably easier to just temporarily disable llvm for the mesa build.
Code:
--disable-llvm
Edit: If you go back far enough you might need this instead, I'm not sure when it was deprecated...
What mesa GL driver are you using? I think unless you have an amdgpu where llvm is needed or are bisecting the llvmpipe its probably easier to just temporarily disable llvm for the mesa build.
I use both R600G and Radeonsi.
I thought llvm is needed for those.
In that case I think you would need llvm, my preferred way of building 32 bit packages is to do so in a 32 bit chroot (A vm would work too) and then use Alien Bob's convertpkg-compat32 script to make a multilib package for my 64-bit install.
I do compile mesa this way and it works for mesa if it compiles with the llvm version installed and then i use convertpkg-compat32 on the created package.
I thought that /etc/profile.d/32dev.sh was the recommended way to compile 32bit packages on multilib as explained in /usr/doc/compat32-tools-*/README
I thought that /etc/profile.d/32dev.sh was the recommended way to compile 32bit packages on multilib as explained in /usr/doc/compat32-tools-*/README
I don't think it is necessarily *the* recommended way. But without doing anything else, it is the only way supported out of the box (and that's likely why it is documented in the README. I always found it much easier to compile 32bit programs in a VM and then run convertpkg-compat32 on the resulting package.
I don't think it is necessarily *the* recommended way. But without doing anything else, it is the only way supported out of the box (and that's likely why it is documented in the README. I always found it much easier to compile 32bit programs in a VM and then run convertpkg-compat32 on the resulting package.
I wonder if clang like gcc should be compiled on an 64bit system to work correctly but i think i need to get more acquainted on multilib and 32bit compiling.
I'm a bit lost but i try to understand things better so i search information everywhere right now.
Not a lot of people realise this, but Slackware's gcc and clang can both cross-compile for i586 without 32dev.sh or multilib.
On gcc, you need the argument '-m32'.
On clang, either you need the arguments '-integrated-as -target i586-slackware-linux', or you need to call the 32 bit executable '/usr/bin/clang-3.8-32' which Alien Bob provides in the package llvm-compat32-3.8.0-x86_64-2compat32.
If you've built your own 64 bit llvm-3.9.1, then you won't have the option of using /usr/bin/clang-3.8-32.
But although gcc and clang can compile for i586, to link they need to use the 32 bit libraries provided by multilib -- the name 'multilib' is a clue.
In the standard multilib setup, 32dev.sh does only two things. It jiggles with the library paths so the 32 bit libraries are found first, and it jiggles with the executable paths. For gcc, various gcc commands are diverted to the small wrapper script /usr/bin/32/gcc, which calls the real gcc with '-m32' (this wrapper script is the only significant difference between the Slackware gcc packages and the multilib gcc packages). For clang, the clang command is diverted to /usr/bin/clang-3.8-32.
If you don't use 32dev.sh, you will get a version of clang that defaults to x86_64.
Maybe you could provide your own clang wrapper script (similar to the gcc script) that provides the compiler arguments you need. It's also possible that clang will need some more 32 bit libraries that are not currently provided by the core multilib packages.
Thank you 55020 for this information.
I had already looked at the wrapper script to know what they do but i didn't know about "-integrated-as -target i586-slackware-linux" yet.
I gave it a spin with stock llvm-4.0.0-x86_64-1 package and it didn't work.
Code:
LANG=C /usr/bin/clang -integrated-as -target i586-slackware-linux hello.c -o hello
/usr/bin/ld: skipping incompatible /usr/bin/../lib64/gcc/x86_64-slackware-linux/5.4.0/../../../libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: skipping incompatible /usr/bin/../lib64/gcc/x86_64-slackware-linux/5.4.0/../../../libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/bin/../lib64/gcc/x86_64-slackware-linux/5.4.0/../../../libc.a when searching for -lc
/lib/libc.so.6: error adding symbols: File format not recognized
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
I have compiled 3.9.1 using llvm.SlackBuild already but i didn't have it installed.
If i installed it and tried again i get the same error except version 4.0 is changed to 3.9
Can anyone else compile a simple hello world on current with "/usr/bin/clang-4.0-32" or "/usr/bin/clang -integrated-as -target i586-slackware-linux" so i know if something is broken on my setup or if it just doesn't work on current?
It looks like clang isn't easily able to do cross-linking out of the box. Your easiest option is to use a vm or 32 bit chroot and build your own llvm inside that, and then use convertpkg-compat32. But that llvm will have the same cross-linking limitations as the existing clang/llvm.
I'm not sure what a better solution would be. It seems gentoo is not affected and they no longer have a lib32 directory or symlink, but I can't figure out why from reading their ebuild.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.