LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM
User Name
Password
Slackware - ARM This forum is for the discussion of Slackware ARM.

Notices


Reply
  Search this Thread
Old 08-18-2021, 10:44 AM   #1
Minime_2003
Member
 
Registered: Aug 2021
Location: Sweden
Distribution: Slackware
Posts: 123

Rep: Reputation: 40
Problem compiling Chromium-ungoogled on a raspberry pi 4 with SARPI (SlackWare ARM-Current RPI)


Hello guys n' girls and slackers.

I am trying to compile Chromium-ungoogled on my raspberry pi 4 installed with SARPI (Slackware ARM -Current)

uname -m shows:
Quote:
armv7l
lscpu shows:
Quote:
Architecture: armv7l
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
Vendor ID: ARM
Model: 3
Model name: Cortex-A72
Stepping: r0p3
CPU max MHz: 1500.0000
CPU min MHz: 600.0000
BogoMIPS: 198.00
Flags: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc3
Do not know if its relevent but i am using raspberry pi´s kernel
as i had to install to get the correct driver for the graphics card and sound card.
Quote:
Linux mediarpi4.not4u.lan 5.10.52-v7l+ #1441 SMP Tue Aug 3 18:11:56 BST 2021 armv7l BCM2711 GNU/Linux
Tried using Alien BOB´s chromium-ungoogled slackbuild.
Managed to edit/change the script so it starts to compile google's clang.
But here is where i get stuck as it complains that there are no compatible triple.

Quote:
error: unable to create target: 'No available targets are compatible with triple "armv7-unknown-linux-gnueabihf"'
At this point i think i have tried everything possible.
Weird thing is that the clang Driver never seems to be able to detect the correct triple:

Starting the compile of clang it shows:
Quote:
-- Performing Test HAS_MAYBE_UNINITIALIZED
-- Performing Test HAS_MAYBE_UNINITIALIZED - Success
-- Native target ARM is not selected; lli will not JIT code
-- Threads enabled.
-- Doxygen disabled.
-- Go bindings enabled.
-- Ninja version: 1.10.2
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- OCaml bindings disabled.
-- Could NOT find Python module pygments
-- Could NOT find Python module pygments.lexers.c_cpp
-- Could NOT find Python module yaml
-- LLVM host triple: armv7l-unknown-linux-gnueabihf
-- LLVM default target triple: armv7l-unknown-linux-gnueabihf
-- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG
-- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG - Success
Repatched AlienBOB's "clang.toolchains.i586.triple.diff"
Quote:
--- clang/lib/Driver/ToolChains/Gnu.cpp.orig 2021-08-08 21:50:13.230299026 +0200
+++ clang/lib/Driver/ToolChains/Gnu.cpp 2021-08-18 01:45:29.292312040 +0200
@@ -2085,10 +2085,15 @@
static const char *const ARMLibDirs[] = {"/lib"};
static const char *const ARMTriples[] = {"arm-linux-gnueabi",
"arm-linux-androideabi"};
- static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
- "armv7hl-redhat-linux-gnueabi",
- "armv6hl-suse-linux-gnueabi",
- "armv7hl-suse-linux-gnueabi"};
+ static const char *const ARMHFTriples[] = {
+ "arm-linux-gnueabihf", "arm-unknown-linux-gnueabihf", "arm-slackware-linux-gnueabihf",
+ "armv6-linux-gnueabihf", "armv6-unknown-linux-gnueabihf", "armv6-slackware-linux-gnueabihf",
+ "armv6l-linux-gnueabihf", "armv6l-unknown-linux-gnueabihf", "armv6l-slackware-linux-gnueabihf",
+ "armv6hl-linux-gnueabihf", "armv6hl-unknown-linux-gnueabihf", "armv6hl-slackware-linux-gnueabihf",
+ "armv7-linux-gnueabihf", "armv7-unknown-linux-gnueabihf", "armv7-slackware-linux-gnueabihf",
+ "armv7l-linux-gnueabihf", "armv7l-unknown-linux-gnueabihf", "armv7l-slackware-linux-gnueabihf",
+ "armv7hl-linux-gnueabihf", "armv7hl-unknown-linux-gnueabihf", "armv7hl-slackware-linux-gnueabihf",
+ "armv7hl-redhat-linux-gnueabi", "armv6hl-suse-linux-gnueabi", "armv7hl-suse-linux-gnueabi"};
static const char *const ARMebLibDirs[] = {"/lib"};
static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
"armeb-linux-androideabi"};
@@ -2111,6 +2116,7 @@
static const char *const X32LibDirs[] = {"/libx32", "/lib"};
static const char *const X86LibDirs[] = {"/lib32", "/lib"};
static const char *const X86Triples[] = {
+ "i486-slackware-linux", "i586-slackware-linux", "i686-slackware-linux",
"i586-linux-gnu", "i686-linux-gnu",
"i686-pc-linux-gnu", "i386-redhat-linux6E",
"i686-redhat-linux", "i386-redhat-linux",
Hoping this would solve the clang Driver detection of the target, but even if i change the target in the script the error is the same anyway?

The diffrent targets i have tried in the build script are:
Quote:
arm-slackware-linux-gnueabihf ;;
armv7-slackware-linux-gnueabihf ;;
armv7l-slackware-linux-gnueabihf ;;
armv7hl-slackware-linux-gnueabihf ;;
Path to gcc information shows:
Quote:
ignoring nonexistent directory "/usr/lib/gcc/arm-slackware-linux-gnueabihf/10.3.0/../../../../arm-slackware-linux-gnueabihf/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/arm-slackware-linux-gnueabihf/10.3.0/include
/usr/local/include
/usr/lib/gcc/arm-slackware-linux-gnueabihf/10.3.0/include-fixed
/usr/include
End of search list.
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 31 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 32 "<command-line>" 2
# 1 "<stdin>"
Please i have run out of idears and need some help and hoping some in here has been dealing with this and maybe have a solution to this issue?

Best regards:
Minime

Last edited by Minime_2003; 08-18-2021 at 10:47 AM.
 
Old 08-18-2021, 01:52 PM   #2
Exaga
SARPi Maintainer
 
Registered: Nov 2012
Distribution: Slackware AArch64
Posts: 1,043

Rep: Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665
Quote:
Originally Posted by Minime_2003 View Post
Hello guys n' girls and slackers.

I am trying to compile Chromium-ungoogled on my raspberry pi 4 installed with SARPI (Slackware ARM -Current)

Please i have run out of idears and need some help and hoping some in here has been dealing with this and maybe have a solution to this issue?
Are you intending to run this software on the Raspberry Pi 4 you're building it on? Try building it without specifying any architecture cflags. Just allow the compiler to pick them up from the system (without forcing the wrong ones) and see if it works for you.

But if/when you are curious to know...
Code:
root@slackware:~# gcc -dumpmachine
arm-slackware-linux-gnueabihf
This is the triplet you'll need to use.

Other cflags that may be of interest...
Code:
root@slackware:~# echo | gcc -v -E - 2>&1 | grep cc1
 /usr/libexec/gcc/arm-slackware-linux-gnueabihf/10.3.0/cc1 -E -quiet -v - 
-mtune=generic-armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -mtls-dialect=gnu -marm -march=armv7-a+fp
 
1 members found this post helpful.
Old 08-18-2021, 03:21 PM   #3
Minime_2003
Member
 
Registered: Aug 2021
Location: Sweden
Distribution: Slackware
Posts: 123

Original Poster
Rep: Reputation: 40
Quote:
Originally Posted by Exaga View Post
Are you intending to run this software on the Raspberry Pi 4 you're building it on? Try building it without specifying any architecture cflags. Just allow the compiler to pick them up from the system (without forcing the wrong ones) and see if it works for you.
Yes, i want to run chromium as a web browser on my Pi 4 and figured it would be easiest to compile the software on the same machine/system
So if i understand you correctly i should just leave the compile flags empty?.

Quote:
Originally Posted by Exaga View Post
Code:
root@slackware:~# gcc -dumpmachine
arm-slackware-linux-gnueabihf
This is the triplet you'll need to use.
As you can see in my first post i added "arm-slackware-linux-gnueabihf" to triplet patch for "clang/lib/Driver/ToolChains/Gnu.cpp"

And also tried adding "arm-slackware-linux-gnueabihf" as target in the build script.
If i understood you correctly?

Quote:
Originally Posted by Exaga View Post
Other cflags that may be of interest...
Code:
root@slackware:~# echo | gcc -v -E - 2>&1 | grep cc1
 /usr/libexec/gcc/arm-slackware-linux-gnueabihf/10.3.0/cc1 -E -quiet -v - 
-mtune=generic-armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -mtls-dialect=gnu -marm -march=armv7-a+fp

I have been using these compile flags:
Code:
SLKCFLAGS="-O2 -march=armv7-a -mtune=cortex-a72 -mfpu=vfpv3-d16 -mfloat-abi=hard"

Thanks for the tips, i'll give it a try removing the flags, and some hybrid of your flags to see if that helps i guess.

Last edited by Minime_2003; 08-18-2021 at 03:26 PM.
 
Old 08-19-2021, 02:35 AM   #4
Exaga
SARPi Maintainer
 
Registered: Nov 2012
Distribution: Slackware AArch64
Posts: 1,043

Rep: Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665
Quote:
Originally Posted by Minime_2003 View Post
Thanks for the tips, i'll give it a try removing the flags, and some hybrid of your flags to see if that helps i guess.

I have been using these compile flags:
Code:
SLKCFLAGS="-O2 -march=armv7-a -mtune=cortex-a72 -mfpu=vfpv3-d16 -mfloat-abi=hard"
I only use -O2 flag for most of the compiling I do on Slackware ARM. Unless the source code requries specific flags to compile successfully I never specify any more than that. It just creates problems more often than not.

If anything, avoid -march and -mtune flags altogether. The -march flag specifies the target architecture. The -mtune flag specifies the target microarchitecture. You don't need these when compiling natively on ARM architecture. If you were cross-compiling on x86 then it would be a different matter.

[EDIT] Thinking about it, all you should ever need in general when compiling natively on ARM is...

Code:
SLKCFLAGS="-O2 -mcpu=native"
So try that and get rid of all the other cflags, because the -mcpu flag on ARM specifies the target architecture the same as ‑march does on x86 machines. I never use the -mcpu flag.

Quote:
-mcpu=native causes the compiler to auto-detect the CPU of the build computer. At present, this feature is only supported on GNU/Linux, and not all architectures are recognized. If the auto-detect is unsuccessful the option has no effect.

https://gcc.gnu.org/onlinedocs/gcc/A...l#index-mcpu-2

Last edited by Exaga; 08-19-2021 at 02:52 AM. Reason: edit
 
Old 08-19-2021, 03:48 AM   #5
Desiderius
Member
 
Registered: Jun 2017
Location: France
Distribution: Slackware
Posts: 151

Rep: Reputation: Disabled
@Minime_2003 you can download the Slackbuild of Chromium 90 of BrunoLafleur

It is a repackaging of the Debian archive, and it works very well on RPI4.

https://github.com/BrunoLafleur/pbsl...s/sbo/chromium

Last edited by Desiderius; 08-19-2021 at 03:49 AM.
 
1 members found this post helpful.
Old 08-19-2021, 07:21 AM   #6
Minime_2003
Member
 
Registered: Aug 2021
Location: Sweden
Distribution: Slackware
Posts: 123

Original Poster
Rep: Reputation: 40
Quote:
Originally Posted by Exaga View Post
I only use -O2 flag for most of the compiling I do on Slackware ARM. Unless the source code requries specific flags to compile successfully I never specify any more than that. It just creates problems more often than not.

If anything, avoid -march and -mtune flags altogether. The -march flag specifies the target architecture. The -mtune flag specifies the target microarchitecture. You don't need these when compiling natively on ARM architecture. If you were cross-compiling on x86 then it would be a different matter.

[EDIT] Thinking about it, all you should ever need in general when compiling natively on ARM is...

Code:
SLKCFLAGS="-O2 -mcpu=native"
So try that and get rid of all the other cflags, because the -mcpu flag on ARM specifies the target architecture the same as ‑march does on x86 machines. I never use the -mcpu flag.
Tried removing the cflags and and only keeping "-O2", trying out your recommendations but still no go.
However as i looked more closely to the compile logs and realized in despair that the script never passed any cflags or cxxflags at all.
Wasted hours doing this
No clue if it makes any diffrence, but i added this code to the script:
Code:
if [[ "$ARCH" =~ arm.* ]]; then
  # When building on ARM there is no need to build all the back-ends
  sed -i tools/clang/scripts/build.py -e "s/targets = \x27AArch64;ARM;Mips;PowerPC;SystemZ;WebAssembly;X86\x27/targets = \x27ARM;X86;AArch64\x27/"
  # And fix the C_FLAGS AND CXX_FLAGS while we are at it:
  sed -i tools/clang/scripts/build.py -e "s/cflags = \[\]/cflags = \['$SLKCFLAGS'\]/"
  sed -i tools/clang/scripts/build.py -e "s/cxxflags = \[\]/cxxflags = \['$SLKCFLAGS'\]/"
fi
Also found some info in this guide How To Build On ARM.
Dont know how relevent or old this is, but i figgure its worth a try?

So i´ll be puting it back to compile again for about the 10000´s time now, and will see if thsi changes the result.

Thanks for all your tips and i´ll keep this updated on how-it all goes.

Quote:
Originally Posted by Desiderius View Post
@Minime_2003 you can download the Slackbuild of Chromium 90 of BrunoLafleur

It is a repackaging of the Debian archive, and it works very well on RPI4.

https://github.com/BrunoLafleur/pbsl...s/sbo/chromium
Thanks, ill try that one out
 
1 members found this post helpful.
Old 08-19-2021, 11:08 AM   #7
Exaga
SARPi Maintainer
 
Registered: Nov 2012
Distribution: Slackware AArch64
Posts: 1,043

Rep: Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665
Quote:
Originally Posted by Minime_2003 View Post
So i´ll be puting it back to compile again for about the 10000´s time now, and will see if thsi changes the result.

Thanks for all your tips and i´ll keep this updated on how-it all goes.
I have to admit, I've not looked into what you're trying to build, although it has to be said that a lot of alienBOB's work is superlative.

In order to be successful, first you need to meet failure many, many times. In my view, those who succeed first time don't learn much. If you're anything like me you'll welcome failure as a means of learning what's right or wrong in all things. However, there can come a time when constant failure can drive someone away from their vision and goals.

BrunoLafleur's GitHub repo that Desiderius gave the link to is simply repackaging the software - which means you don't have to waste time and effort building it yourself. If all you want to achieve is for it to work then that may be your best and easiest option.
 
Old 08-19-2021, 01:09 PM   #8
Minime_2003
Member
 
Registered: Aug 2021
Location: Sweden
Distribution: Slackware
Posts: 123

Original Poster
Rep: Reputation: 40
Quote:
Originally Posted by Exaga View Post
I have to admit, I've not looked into what you're trying to build, although it has to be said that a lot of alienBOB's work is superlative.
I couldn't agree more, that guy has done massive and amazing work. No doubt about it. A brilliant guy

Quote:
Originally Posted by Exaga View Post
In order to be successful, first you need to meet failure many, many times. In my view, those who succeed first time don't learn much. If you're anything like me you'll welcome failure as a means of learning what's right or wrong in all things. However, there can come a time when constant failure can drive someone away from their vision and goals.
Thats true, Just get sligtly anoyed when wating 5-6 hours and the results in failure...
And to try something new one has to wait yet another 5-6 hours...really time consuming thats all =)
But i don't mind learning from what i am doing and trying to achieve.

Quote:
Originally Posted by Exaga View Post
BrunoLafleur's GitHub repo that Desiderius gave the link to is simply repackaging the software - which means you don't have to waste time and effort building it yourself. If all you want to achieve is for it to work then that may be your best and easiest option.
Yes, it might be the easiest way resolve it in the end if its not possible to build on the system it self.
However i don't like adding loads of third party (Non slackware libs and dependencies) and i´d like to see if i can get chromium to be able to use Widevine on ARM which i suspect is not even possible if using a debian build for ahole lot of reasons.

Last edited by Minime_2003; 08-19-2021 at 01:10 PM.
 
Old 08-19-2021, 07:40 PM   #9
glorsplitz
Senior Member
 
Registered: Dec 2002
Distribution: slackware!
Posts: 1,310

Rep: Reputation: 368Reputation: 368Reputation: 368Reputation: 368
@Desiderius, thank you!

Quote:
Package chromium-90.0.4430.212-arm-1_SBo.txz installed.
 
Old 08-20-2021, 04:17 AM   #10
Exaga
SARPi Maintainer
 
Registered: Nov 2012
Distribution: Slackware AArch64
Posts: 1,043

Rep: Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665
Quote:
Originally Posted by Minime_2003 View Post
Thats true, Just get sligtly anoyed when wating 5-6 hours and the results in failure...
And to try something new one has to wait yet another 5-6 hours...really time consuming thats all =)
Have you specified multi jobs with the 'make -j$(nproc)' option? You can also use the -k option to keep-going which continues as much as possible after an error. This dramatically speeds up any compilation process in general. If you've already included this then I'm sorry to waste your time.

https://www.gnu.org/software/make/ma...s-Summary.html
 
Old 08-20-2021, 09:00 AM   #11
Minime_2003
Member
 
Registered: Aug 2021
Location: Sweden
Distribution: Slackware
Posts: 123

Original Poster
Rep: Reputation: 40
Quote:
Originally Posted by Exaga View Post
Have you specified multi jobs with the 'make -j$(nproc)' option? You can also use the -k option to keep-going which continues as much as possible after an error. This dramatically speeds up any compilation process in general. If you've already included this then I'm sorry to waste your time.

https://www.gnu.org/software/make/ma...s-Summary.html
I usally do this in other build scripts, but as chromium uses loads of phyton stuff for the builds, i dont know
where everything is located.
however i suspect the script is using some kind of "-j" command, as i can see 4-5 threds of the compile prosseses when looking in "top" during the build.

Cant say that its worth trying to get the compiler to keep going when the compilre reports googles clang compiler as broken (Needed later to compile chromium).
So its ok for it to stop there as the error comes at the end when the system is to test the compiler for errors.
I dont get eny other other errors during the compile, so i dont know why or how to get around nore solve this issue?

But as it looks at the moment, its not possible to build googles clang on Slackware Arm...
So i´v been thinking, would it be possible to ise the systems clang version?
How-to solve the problem with googles build using lld as this does not exist in the system?

No worries, all tips and idears are more than welcome and I really appreciate it.
 
Old 08-20-2021, 02:50 PM   #12
Exaga
SARPi Maintainer
 
Registered: Nov 2012
Distribution: Slackware AArch64
Posts: 1,043

Rep: Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665
Quote:
Originally Posted by Minime_2003 View Post
No worries, all tips and idears are more than welcome and I really appreciate it.
I looked into the chromium.SlackBuild by alienBOB and it uses clang to build by default, not gcc. So all the advice I've posted about gcc options is irrelevant.
 
Old 08-20-2021, 07:22 PM   #13
Minime_2003
Member
 
Registered: Aug 2021
Location: Sweden
Distribution: Slackware
Posts: 123

Original Poster
Rep: Reputation: 40
Quote:
Originally Posted by Exaga View Post
I looked into the chromium.SlackBuild by alienBOB and it uses clang to build by default, not gcc. So all the advice I've posted about gcc options is irrelevant.
Its ok, well it depends on what system you are running.
Ex. if one uses x86_64 the script downloads googles prebuilt llvm/clang binaries to compile chromium.
If you use i686 the script downloads googles llvm/clang source code and compiles it with gcc i think, then after it has compiled llvm/clang it
switches to googles llvm/clang to compile chromium.

Gave up trying to compile googles llvm/clang on arm, as i looks it does not support building this on arm systems.
So the new goal is to get the script to compile by using the systems own clang instead.
 
Old 08-20-2021, 07:36 PM   #14
glorsplitz
Senior Member
 
Registered: Dec 2002
Distribution: slackware!
Posts: 1,310

Rep: Reputation: 368Reputation: 368Reputation: 368Reputation: 368
Quote:
Originally Posted by Desiderius View Post
@Minime_2003 you can download the Slackbuild of Chromium 90 of BrunoLafleur

It is a repackaging of the Debian archive, and it works very well on RPI4.

https://github.com/BrunoLafleur/pbsl...s/sbo/chromium
I got it built but it fails

Code:
/usr/bin/chromium
cat: /etc/debian_version: No such file or directory
/usr/lib/chromium/chromium: error while loading shared libraries: libjsoncpp.so.24: cannot open shared object file: No such file or directory
I imagine I could fake out /etc/debian_version but will jsoncpp (1.9.2) take care of libjsoncpp.so.24?

@Desiderius which libjsoncpp.so you have installed?

Last edited by glorsplitz; 08-20-2021 at 07:38 PM.
 
Old 08-21-2021, 04:06 AM   #15
Exaga
SARPi Maintainer
 
Registered: Nov 2012
Distribution: Slackware AArch64
Posts: 1,043

Rep: Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665
Quote:
Originally Posted by Minime_2003 View Post
Gave up trying to compile googles llvm/clang on arm, as i looks it does not support building this on arm systems.
So the new goal is to get the script to compile by using the systems own clang instead.
Just to satisfy my curiosity, why Chromium? Is it specifically required for something you're doing/planning or simply your preferred browser?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[Double post]Problem compiling Chromium on a raspberry pi 4 with SARPI (SlackWare ARM-Current RPI) Minime_2003 Slackware - ARM 0 08-19-2021 06:54 PM
Pure Alsa Ungoogled Chromium fcv623 Slackware 11 06-17-2020 02:56 PM
[SOLVED] Sarpi / Raspberry (RPi 3) - sound issue under 5.4.18-v7-arm eduardr Slackware - ARM 11 02-28-2020 04:12 AM
[SOLVED] Sarpi / Raspberry (RPi 3) - touchscreen input not working since kernel 5.4.x eduardr Slackware - ARM 9 02-13-2020 12:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM

All times are GMT -5. The time now is 12:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration