LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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-25-2021, 06:57 AM   #31
drmozes
Slackware Contributor
 
Registered: Apr 2008
Distribution: Slackware
Posts: 1,542

Rep: Reputation: 1310Reputation: 1310Reputation: 1310Reputation: 1310Reputation: 1310Reputation: 1310Reputation: 1310Reputation: 1310Reputation: 1310Reputation: 1310

Quote:
Originally Posted by Minime_2003 View Post
Code:
-  armv6hl)   SLKCFLAGS="-O2 -march=armv6 -mfpu=vfp -mfloat-abi=hard"
-             SLKLDFLAGS=""; LIBDIRSUFFIX=""
+  armv6*)    SLKCFLAGS="-O2 -march=armv6 -mfpu=vfp -mfloat-abi=hard"
+             # Fix for using lld while linking chromium in a 32bit chroot:
+             SLKLDFLAGS="-Wl,-z,notext"; LIBDIRSUFFIX=""
              DSSE="1"
              # Widevine not supported (no binary library available):
As you're only targeting 32bit hardware floating point here, setting the architecture to be armv6 doesn't make sense because the OS itself is built for a baseline armv7. This setting only makes sense if you're building Chromium on 32bit Slackware ARM software floating point (Slackware v14.2) where the OS's baseline is armv5.
 
Old 08-25-2021, 08:25 AM   #32
Minime_2003
Member
 
Registered: Aug 2021
Location: Sweden
Distribution: Slackware
Posts: 118

Original Poster
Rep: Reputation: 39
Quote:
Originally Posted by drmozes View Post
As you're only targeting 32bit hardware floating point here, setting the architecture to be armv6 doesn't make sense because the OS itself is built for a baseline armv7. This setting only makes sense if you're building Chromium on 32bit Slackware ARM software floating point (Slackware v14.2) where the OS's baseline is armv5.
At the moment i have no clue at all, even less when it comes to armv6.
It´s mostly just trial and error, enought problems as it is getting it to build on armv7l and sarpi current.
Time consuming as everything takes time...

At the moment i cant even get ninja to compile beyond [10/49672]
as i get this error:
Code:
FAILED: obj/base/third_party/libevent/libevent/http.o
Most likely changed something in the script somewhere... Trying to figure out what i changed...

If you have any good tips or suggestions then I am more than happy to take a note of it as i would really appreciate it.

Update:
After poking around in chromiums "tools/clang/scripts/build.py" i noticed that some of the build profiles use "libcxx".
But not all of them, and i had set "use_custom_libcxx" to true, it might cause the error i got?
But because i did not build llvm with libcxx, this might be a big problem.
Worst Case scenario is to rebuild llvm with libcxx and set "use_custom_libcxx" back to true again.

Update2:
Well i know now why i could not get past [10/49672], reson was that when i managed to get as far as "[10846/49671]" was because i was compiling ungoogled chromium.
So after removing some breaking chromium options it might be possibel to compile ungoogled chromium with clang.
So why dont i just compile with gcc instead. well i have some issues with gcc too. (Might be because of some breaking options, but havent looked much futher in to this).
And second reason is that compiling with clang, compile should go faster and the binary also should be smaller.

Last edited by Minime_2003; 08-25-2021 at 07:10 PM.
 
Old 08-26-2021, 01:20 AM   #33
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 why dont i just compile with gcc instead. well i have some issues with gcc too. (Might be because of some breaking options, but havent looked much futher in to this).
I did some light reading about building Chromium-ungoogled and found myself on Eric's 'Chromium is now compiled using clang' blog page from October 2017. Amongst a great deal of useful information he states "the Google developers use clang instead of gcc for their own compilations and therefore gcc support is becoming stale." and also "after a week of trial and error (especially the 32bit build gave me headaches) I managed to add all the needed bits and pieces to my chromium.SlackBuild." So, by my reckoning, if it gave Eric headaches then it's surely going to give me cogent nightmares.

On another 'How to ‘un-google’ your Chromium browser experience' blog page by Eric (from March 2021) that I read, he says "I am running chromium-ungoogled now also on Slackware 14.2 and indeed it works flawlessly even though it was compiled on Slackware-current. Probably because chromium.SlackBuild first compiles llvm using the system gcc and then compiles chromium with that custom llvm. No dependencies on system gcc or glibc that way." Sounds a little like playing compiler ping-pong with dependencies to me.

Now, I fully understand and appreciate why Eric has put so much time and hard work into making Chromium browser available for Slackware users. It just seems like a HELL_OF_A_LOT of hard work to achieve success. If I actually used Slackware ARM as a desktop and wanted to build any browser software then I would most likely choose IceCat (formally known as Ice Weasel) because there is much less questionability where transparency, inconspicuous methods, and ethics are concerned than anything where Google has had input.

[My two cents] : I'm not especially a fan of anything where Google has influence but some of the details that are shared on Eric's blog pages above is enough to totally put me off trying to build, or even use, Chromium browser for Slackware [ARM]. I use the Google search engine (to my peril) and prefer to remain blissfully unaware of any implications or ramifications. This is somewhat difficult to avoid on websites which feature Google-ads which seem to predominantly offer me tailored items and/or services for whatever I was recently looking up on Google search engine.

However, that being said, I think what you're trying to achieve is a very noble and admirable venture. Building your own software with Slackware [ARM] is a joy to behold, once success has been realised. Best of luck to you that you prosper and achieve it quickly.
 
1 members found this post helpful.
Old 08-27-2021, 05:38 PM   #34
Minime_2003
Member
 
Registered: Aug 2021
Location: Sweden
Distribution: Slackware
Posts: 118

Original Poster
Rep: Reputation: 39
Quote:
Originally Posted by Exaga View Post
I did some light reading about building Chromium-ungoogled and found myself on Eric's 'Chromium is now compiled using clang' blog page from October 2017. Amongst a great deal of useful information he states "the Google developers use clang instead of gcc for their own compilations and therefore gcc support is becoming stale." and also "after a week of trial and error (especially the 32bit build gave me headaches) I managed to add all the needed bits and pieces to my chromium.SlackBuild." So, by my reckoning, if it gave Eric headaches then it's surely going to give me cogent nightmares.
Yes been reading a bit there too and also some comments in the scripts he has.
He has a great blog with loads of good stuff.:hat tip:
One can learn alot from him.

When it comes to headaches and nightmares, well i think i gone way beyond that already and going insane and bonkers...

Quote:
Originally Posted by Exaga View Post
On another 'How to ‘un-google’ your Chromium browser experience' blog page by Eric (from March 2021) that I read, he says "I am running chromium-ungoogled now also on Slackware 14.2 and indeed it works flawlessly even though it was compiled on Slackware-current. Probably because chromium.SlackBuild first compiles llvm using the system gcc and then compiles chromium with that custom llvm. No dependencies on system gcc or glibc that way." Sounds a little like playing compiler ping-pong with dependencies to me.
Hahahaa, well to be honest, when looking at the script, i dont even know half whats going on there as there are passes between the build and system-root right left and center...So yes ping-pong is a good decription :-p

All way beond my knowlaged too i´d say...

Quote:
Originally Posted by Exaga View Post
Now, I fully understand and appreciate why Eric has put so much time and hard work into making Chromium browser available for Slackware users. It just seems like a HELL_OF_A_LOT of hard work to achieve success. If I actually used Slackware ARM as a desktop and wanted to build any browser software then I would most likely choose IceCat (formally known as Ice Weasel) because there is much less questionability where transparency, inconspicuous methods, and ethics are concerned than anything where Google has had input.
Well yes, i have to agree with you, I can just imagine and respect the time and effort Eric has put in to all his briljent work.
As i have spent two weeks or something now and got nowhere at all. But then again, i dont even have half the knowledge and brains compared to most of the folks here.

Thanks for the tip i´ll have to look in to that.

Quote:
Originally Posted by Exaga View Post
[My two cents] : I'm not especially a fan of anything where Google has influence but some of the details that are shared on Eric's blog pages above is enough to totally put me off trying to build, or even use, Chromium browser for Slackware [ARM]. I use the Google search engine (to my peril) and prefer to remain blissfully unaware of any implications or ramifications. This is somewhat difficult to avoid on websites which feature Google-ads which seem to predominantly offer me tailored items and/or services for whatever I was recently looking up on Google search engine.
True, google has become too large of a company, and i get the feeling like thay are some kind of "Big brother", collecting way to much information.
But thats also why id like to have acived to build chromium-ungoogled.

Quote:
Originally Posted by Exaga View Post
However, that being said, I think what you're trying to achieve is a very noble and admirable venture. Building your own software with Slackware [ARM] is a joy to behold, once success has been realised. Best of luck to you that you prosper and achieve it quickly.
Thank you for the kind words and really appreciate it.
However, i think i am defeated as i now am stuck, and dont think i will be able to resolve this puzzle. This is way over my knowledge and i dont know how to resolve it, or if its even possible.

Because no matter what configuration i try to set, i just cant get the compile to go futher.
For what ever reson python cant find "arm-linux-gnueabihf-readelf" directory, even thow it is located in both systemroot and in the system itself.
Code:
[10349/49669] SOLINK swiftshader/libEGL.so
FAILED: swiftshader/libEGL.so swiftshader/libEGL.so.TOC
python3 "../../build/toolchain/gcc_solink_wrapper.py" --readelf="arm-linux-gnueabihf-readelf" --nm="../../../../../../opt/llvm/bin/llvm-nm"  --sofile="swiftshader/libEGL.so" --tocfile="swiftshader/libEGL.so.TOC" --output="swiftshader/libEGL.so" -- ../../../../../../opt/llvm/bin/clang++ -shared -Wl,-soname="libEGL.so" -Wl,--version-script=../../third_party/swiftshader/src/OpenGL/libEGL/libEGL.lds -fuse-ld=lld -Wl,--build-id -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,-z,defs -Wl,--as-needed -Wl,--icf=all -Wl,--color-diagnostics -Wl,--no-call-graph-profile-sort --target=arm-linux-gnueabihf -Wl,-O2 -Wl,--gc-sections -rdynamic -nostdlib++ --sysroot=../../build/linux/debian_sid_arm-sysroot -L../../build/linux/debian_sid_arm-sysroot/usr/lib/arm-linux-gnu/nss -L../../build/linux/debian_sid_arm-sysroot/usr/local/lib/arm-linux-gnueabihf -L../../build/linux/debian_sid_arm-sysroot/lib/arm-linux-gnueabihf -L../../build/linux/debian_sid_arm-sysroot/usr/lib/arm-linux-gnueabihf -Wl,--gc-sections -Wl,--hash-style=both -o "swiftshader/libEGL.so" @"swiftshader/libEGL.so.rsp"
Traceback (most recent call last):
  File "/tmp/build/tmp-chromium/chromium-92.0.4515.159/out/Release/../../build/toolchain/gcc_solink_wrapper.py", line 198, in <module>
    sys.exit(main())
  File "/tmp/build/tmp-chromium/chromium-92.0.4515.159/out/Release/../../build/toolchain/gcc_solink_wrapper.py", line 176, in main
    result, toc = CollectTOC(args)
  File "/tmp/build/tmp-chromium/chromium-92.0.4515.159/out/Release/../../build/toolchain/gcc_solink_wrapper.py", line 50, in CollectTOC
    result, toc = CollectSONAME(args)
  File "/tmp/build/tmp-chromium/chromium-92.0.4515.159/out/Release/../../build/toolchain/gcc_solink_wrapper.py", line 25, in CollectSONAME
    readelf = subprocess.Popen(wrapper_utils.CommandToRun(
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'arm-linux-gnueabihf-readelf'
[10350/49669] CXX obj/third_party/swiftshader/src/OpenGL/libGLESv2/swiftshader_libGLESv2_static/utilities.o
[10351/49669] CXX obj/third_party/swiftshader/src/OpenGL/libGLESv2/swiftshader_libGLESv2/entry_points.o
[10352/49669] CXX obj/third_party/swiftshader/src/OpenGL/libGLESv2/swiftshader_libGLESv2_static/Query.o
[10353/49669] CXX obj/third_party/swiftshader/src/OpenGL/libGLESv2/swiftshader_libGLESv2_static/Program.o
[10354/49669] CC obj/third_party/sqlite/chromium_sqlite3/sqlite3_shim.o
In file included from ../../third_party/sqlite/sqlite3_shim.c:16:
../../third_party/sqlite/src/amalgamation/sqlite3.c:151256:10: warning: variable 'rLogSize' set but not used [-Wunused-but-set-variable]
  LogEst rLogSize;            /* Logarithm of the number of rows in the table */
         ^
1 warning generated.
ninja: build stopped: subcommand failed.
ninja: Entering directory `out/Release'
As far as i can see all should be in order?
Code:
~# readelf -l /bin/ls | grep 'program interpreter'
[Requesting program interpreter: /lib/ld-linux-armhf.so.3]
Wondering if it's some way to force or fool it, by soft linking the files "swiftshader/libEGL.so, swiftshader/libEGL.so.TOC" from the system alternatively link the "arm-linux-gnueabihf-readelf" directory somehow?

libEGL.so located in "/opt/vc/lib/libEGL.so" for the raspberry pi system.
But this is also declared in "/etc/ld.so.conf" system file.

But as i stated before, this is way beond my knowlaged.
I have no clue what so ever how-to get around this issue or if its even possible?
Last option is maybe just to crosscompile it all on a 64bit system instead, but i have no clue how this should be done either.

Last edited by Minime_2003; 08-27-2021 at 05:56 PM.
 
1 members found this post helpful.
Old 08-28-2021, 05:01 AM   #35
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
When it comes to headaches and nightmares, well i think i gone way beyond that already and going insane and bonkers...

Hahahaa, well to be honest, when looking at the script, i dont even know half whats going on there as there are passes between the build and system-root right left and center...So yes ping-pong is a good decription :-p

All way beond my knowlaged too i´d say...
My advice would be, never let any software-building problem affect your focus or motivation negatively. Often it's a matter of perception, and I always say that "Perception is 99% of everything." Sometimes software development requires you to do things in a way which is confusing, or totally illogical, or exacerbates the ability to learn and understand what you're doing and why. Although, that cannot ever be said of Slackware, I have found when trying to build certain software to use with Slackware (e.g. when it's not already included as a pkg or there's no SlackBuild available) it can be a mind-numbingly vacuous experience. Different [groups of] people will always do things their own way, which is sometimes unscrupulously Byzantine and counter-productive towards success. Generally it's a case of finding your own route and solution(s) when there's no prior advice, or work, or examples, to guide you. I'd assert that you're most of the way there with Eric's scripts. It's just making it all work on ARM architecture instead of x86_64. Easier said than done, I assume from your feedback.

Quote:
Originally Posted by Minime_2003 View Post
As i have spent two weeks or something now and got nowhere at all. But then again, i dont even have half the knowledge and brains compared to most of the folks here.
You've spent two weeks on learning and gaining experience. Remember that pioneering success is usually achieved after innumerous failures. We all started off knowing nothing about what we're doing, or striving towards, now and you certainly have more knowledge and brains about what you're trying to achieve than I do.

Quote:
Originally Posted by Minime_2003 View Post
True, google has become too large of a company, and i get the feeling like thay are some kind of "Big brother", collecting way to much information. But thats also why id like to have acived to build chromium-ungoogled.
Allow me to share some of my Google [WTF?!?!, LMFAO, ZOMG! SMH] experiences. Recently I watched a 'Technical Support Fundamentals' lecture video (by Kevin Limehouse - Google Support Specialist) who informed me that, "Alan Turning helped to develop the top secret Enigma machine which helped Allied forces to decode Axis messages during WW2." Firstly, his surname is 'Turing'. Secondly, he was a member of the team who helped to break the Enigma code in the United Kingdom, not invented it! Thirdly, it was the British, French, and especially Polish, decryption teams (collectively) who were mainly responsible for breaking the Enigma code. Lastly, the Enigma machine in this context created encrypted messages for the German military during WW2, not decoded them for the Allies. So, I don't know where Google Support Specialists get their autocue information from but it's certainly not Wikipedia or any reliable fact-based sources!

Recently, I searched for "chopsticks" on eBay and Amazon and, for the past week or so, every website I view that features Google-ads is offering me... guess what? If you replied "chopsticks" you'd be 100% correct. I don't see a plethora of offers for Slackware from Google-ads, or LinuxQuestions, or any other Linux related info I lookup on the Internet or their search engine. Most likely because Slackware and LQ doesn't pay Google to facilitate the distribution of sales spam in order to ram it in users' faces!

You might like to read - Linux distributors frustrated by Google's new Chromium web browser restrictions - which is quite informative and also features a pertinent quote or two from a certain Eric Hameleers.

Quote:
Originally Posted by Minime_2003 View Post
However, i think i am defeated as i now am stuck, and dont think i will be able to resolve this puzzle. This is way over my knowledge and i dont know how to resolve it, or if its even possible.

I have no clue what so ever how-to get around this issue or if its even possible?
Last option is maybe just to crosscompile it all on a 64bit system instead, but i have no clue how this should be done either.
I would advise you to do how MoZes once advised me in these situations; "Look on other Linux OS, especially Debian, which features the same software to see how it works." In the past I have overcome many hurdles and solved quite a few conumdrums by doing so. Cross-compiling for ARM can be a very hit and miss affair - it depends whether the software you're building will include any specific ARM related libraries and settings (where applicable) when being compiled on a different hardware architecture.

Last edited by Exaga; 08-28-2021 at 05:07 AM. Reason: it's the weekend! \o/
 
2 members found this post helpful.
Old 08-28-2021, 12:51 PM   #36
Minime_2003
Member
 
Registered: Aug 2021
Location: Sweden
Distribution: Slackware
Posts: 118

Original Poster
Rep: Reputation: 39
Quote:
Originally Posted by Exaga View Post
I would advise you to do how MoZes once advised me in these situations; "Look on other Linux OS, especially Debian, which features the same software to see how it works." In the past I have overcome many hurdles and solved quite a few conumdrums by doing so. Cross-compiling for ARM can be a very hit and miss affair - it depends whether the software you're building will include any specific ARM related libraries and settings (where applicable) when being compiled on a different hardware architecture.
Thats also one of all the resons im wondering why there is so little information anywhere about compiling or even building chromium on the system natively.
Most guides and builds for chromium are by using crosscompiling with debian or ubuntu as far as i can see...
All build tools and toolchains are downloaded and installed by using apt-get.
There are also some short guides, pointers and tips for using RedHat or Suse, but really not much to go on regarding that.

Might also be one of many reasons why google has chosen to not make it possible to compile for arm on the system itself by the python build script. located at "tools/clang/scripts/build.py"
If one had some pyton knowlaged, it would be fun to see if it maede the slightest diffrence building its own clang directly and also see if this would make the slightest diffrence.

BTW, thanks you for the tips and kind words.
 
1 members found this post helpful.
Old 08-30-2021, 04:03 AM   #37
Minime_2003
Member
 
Registered: Aug 2021
Location: Sweden
Distribution: Slackware
Posts: 118

Original Poster
Rep: Reputation: 39
I might actually have come up with a easier solution.
Thow it would save some compiling time to be able to use a precompiled custom llvm/clang and not have to need to compile that every time.
I think i managed to figure out how-to force the build script to compile google's own clang.

However, my guess is that this build would take about 24 hours at least, if it works. Have not managed to test this yet as i just started the build.
Fingers crossed, but it might actually work.

Added latest patchset and some patches to make the build easier.
Code:
--- chromium.SlackBuild.orgi	2021-08-30 10:32:17.588192175 +0200
+++ chromium.SlackBuild	2021-08-30 10:42:35.862204292 +0200
@@ -568,7 +568,7 @@
 if [ -z "$ARCH" ]; then
   case "$MARCH" in
     i?86)    export ARCH=i586 ;;
-    armv7hl) export ARCH=$MARCH ;;
+    armv7*) export ARCH=$MARCH ;;
     armv6hl) export ARCH=$MARCH ;;
     arm*)    export ARCH=arm ;;
     # Unless $ARCH is already set, use uname -m for all other archs:
@@ -605,18 +605,20 @@
              #DSSE="0"
              DSSE="1"
              ;;
-  armv7hl)   SLKCFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16"
-             SLKLDFLAGS=""; LIBDIRSUFFIX=""
-             DSSE="1"
+  armv7*)    SLKCFLAGS="-O2 -march=armv7-a -mtune=cortex-a72 -mfpu=vfpv3-d16 -mfloat-abi=hard"
+             #SLKLDFLAGS=""; LIBDIRSUFFIX=""
+             SLKLDFLAGS="-Wl,-z,notext"; LIBDIRSUFFIX=""
+             DSSE="1"
              # Widevine not supported (no binary library available):
-             USE_CDM=0
+             USE_CDM=0
              FFMPEG_ARCH="arm"
              SYSROOT_ARCH="arm"
              SYSROOT_TARGET="arm"
              PKGARCH="$ARCH"
              ;;
   armv6hl)   SLKCFLAGS="-O2 -march=armv6 -mfpu=vfp -mfloat-abi=hard"
-             SLKLDFLAGS=""; LIBDIRSUFFIX=""
+             #SLKLDFLAGS=""; LIBDIRSUFFIX=""
+             SLKLDFLAGS="-Wl,-z,notext"; LIBDIRSUFFIX=""
              DSSE="1"
              # Widevine not supported (no binary library available):
              USE_CDM=0
@@ -638,7 +640,8 @@
 esac
 
 case "$ARCH" in
-    arm*)    TARGET=$ARCH-slackware-linux-gnueabi ;;
+    #arm*)    TARGET=$ARCH-slackware-linux-gnueabi ;;
+    arm*)    TARGET=$SYSROOT_TARGET-slackware-linux-gnueabihf ;;
     *)       TARGET=$ARCH-slackware-linux ;;
 esac
 
@@ -750,6 +753,36 @@
 # Be compatible with gcc 10:
 cat $SRCDIR/patches/chromium_gcc10.patch | patch -p1 --verbose \
   2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log
+
+# Latest patchsets for chromium-92.0.4515.x
+# Fixes for building with libstdc++ instead of libc++
+cat $SRCDIR/patches/chromium-90-ruy-include.patch \
+  | patch -p1 --verbose 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log
+cat $SRCDIR/patches/chromium-78-protobuf-RepeatedPtrField-export.patch \
+  | patch -p1 --verbose 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log
+# Disable various compiler configs
+#cat $SRCDIR/patches/chromium-91-compiler.patch \
+#  | patch -p1 --verbose 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log
+cat $SRCDIR/patches/chromium-swiftshader-export.patch \
+  | patch -p1 --verbose 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log
+# GCC: make VRegister::from_code() constexpr on aarch64
+# On arm64 you need to update bundled third_party/highway to 0.12.1
+# and append -flax-vector-conversions to your CXXFLAGS.
+cat $SRCDIR/patches/chromium-92-v8-constexpr.patch \
+  | patch -p1 --verbose 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log
+# Additional patch for chromium-91 (arm64 only)
+cat $SRCDIR/patches/chromium-91-libyuv-aarch64.patch \
+  | patch -p1 --verbose 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log
+
+# Arch Chromium patches to fix eu-strip-build.
+cat $SRCDIR/arch_patches/0003-Fix-eu-strip-build-for-newer-GCC.patch \
+  | patch -p1 --verbose 2>&1 | tee -a $OUTPUT/arch_patch-${PRGNAM}.log
+
+# Third party patches
+# Fixes harfbuzz-ng unused variable `supp_size` from plan_subset_encoding(...)
+cat $SRCDIR/third_party_patches/fix-harfbuzz-supp-size.patch \
+  | patch -p1 --verbose 2>&1 | tee -a $OUTPUT/arch_patch-${PRGNAM}.log
+
 # Fix the link on 32bit:
 sed -e '/ldflags /s/-m32/&", "-Wl,-z,notext/' \
   -i build/config/compiler/BUILD.gn
@@ -760,7 +793,8 @@
 # Slackware specific:
 # When compiling google's clang on 32bit Slackware use 'i586' in the triplet.
 # I am a python noob so this is clumsy, better implementation is welcome :-)
-cp $SRCDIR/patches/clang.toolchains.i586.triple.diff .
+#cp $SRCDIR/patches/clang.toolchains.i586.triple.diff .
+cp $SRCDIR/patches/clang.toolchains.arm_i586.triple.diff .
 cat $SRCDIR/patches/chromium_32bit_triplet.patch | patch -p1 --verbose \
   2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log
 # Don't crap out when gzip does not support '--rsyncable' (Slackware < 14.2):
@@ -797,6 +831,16 @@
     2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log
 fi
 
+# If ARM, then try to force the build script to build clang for arm instead of x86
+if [[ "$ARCH" =~ arm.* ]]; then
+  # We are compiling clang with bootstrap for ARM and not X86.
+  sed -i tools/clang/scripts/build.py -e "s/bootstrap_targets = \x27X86\x27/bootstrap_targets = \x27ARM\x27/"
+  # We are using ARM, so to speed things up we only build the relevant back-ends (ARM,AArch64 and x86), 
+  # since it’s very unlikely that we will cross-compile to other arches.
+  # x86 is allso needed for Compiler-RT tests.
+  sed -i tools/clang/scripts/build.py -e "s/targets = \x27AArch64;ARM;Mips;PowerPC;SystemZ;WebAssembly;X86\x27/targets = \x27ARM;X86;AArch64\x27/"
+fi
+
 # When compiling google's clang, we want 32bit too - don't limit us, devs:
 sed -i tools/clang/scripts/build.py -e "s/x86_64-unknown-linux-gnu/$TARGET/g"
 
@@ -860,69 +904,122 @@
 # After building gn, run:
 # "./out/Release/gn args out/Release --list"
 # for a list of all variables.
-_chromium_conf=(
-    'enable_hidpi=true'
-    "enable_platform_hevc=${do_hevc}"
-    'enable_platform_ac3_eac3_audio=true'
-    'enable_platform_mpeg_h_audio=true'
-    'enable_platform_dolby_vision=true'
-    'enable_mse_mpeg2ts_stream_parser=true'
-    'enable_precompiled_headers=false'
-    'enable_swiftshader=true'
-    'enable_webrtc=true'
-    'fatal_linker_warnings=false'
-    "ffmpeg_branding=\"${FFMPEG_BRANDING}\""
-    "is_clang=${do_clang}"
-    'is_debug=false'
-    "is_component_build=${SHARED_FFMPEG}"
-    "is_component_ffmpeg=${SHARED_FFMPEG}"
-    "link_pulseaudio=${do_pa}"
-    "linux_sandbox_path=\"/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/chrome_sandbox\""
-    #'linux_strip_binary=true'
-    'linux_use_bundled_binutils=false'
-    "ozone_platform_wayland=${do_wayland}"
-    #"rtc_use_pipewire=${do_wayland}"
-    #"rtc_link_pipewire=${do_wayland}"
-    #'rtc_pipewire_version="0.3"' # Otherwise chromium tries to link absent 0.2 
-    'proprietary_codecs=true'
-    'remove_webcore_debug_symbols=true'
-    'symbol_level=0'
-    'treat_warnings_as_errors=false'
-    "usb_ids_path=\"/usr/share/hwdata/usb.ids\""
-    'use_allocator="none"'
-    'use_bundled_fontconfig=false'
-    'use_cfi_icall=false' # https://crbug.com/866290
-    'use_cups=true'
-    'use_custom_libcxx=true'
-    'use_gconf=false'
-    'use_kerberos=false'
-    'use_lld=true'
-    'use_ozone=true'
-    "use_pulseaudio=${do_pa}"
-    "use_sysroot=${do_sysroot}"
-    'use_vaapi=true'
-    "use_xkbcommon=${do_wayland}"
-    "extra_cxxflags=\"${CXXFLAGS}\""
-    "extra_ldflags=\"${LDFLAGS}\""
-)
+if [[ ! "$ARCH" =~ arm.* ]]; then
+  _chromium_conf=(
+      'enable_hidpi=true'
+      "enable_platform_hevc=${do_hevc}"
+      'enable_platform_ac3_eac3_audio=true'
+      'enable_platform_mpeg_h_audio=true'
+      'enable_platform_dolby_vision=true'
+      'enable_mse_mpeg2ts_stream_parser=true'
+      'enable_precompiled_headers=false'
+      'enable_swiftshader=true'
+      'enable_webrtc=true'
+      'fatal_linker_warnings=false'
+      "ffmpeg_branding=\"${FFMPEG_BRANDING}\""
+      "is_clang=${do_clang}"
+      'is_debug=false'
+      "is_component_build=${SHARED_FFMPEG}"
+      "is_component_ffmpeg=${SHARED_FFMPEG}"
+      "link_pulseaudio=${do_pa}"
+      "linux_sandbox_path=\"/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/chrome_sandbox\""
+      #'linux_strip_binary=true'
+      'linux_use_bundled_binutils=false'
+      "ozone_platform_wayland=${do_wayland}"
+      #"rtc_use_pipewire=${do_wayland}"
+      #"rtc_link_pipewire=${do_wayland}"
+      #'rtc_pipewire_version="0.3"' # Otherwise chromium tries to link absent 0.2 
+      'proprietary_codecs=true'
+      'remove_webcore_debug_symbols=true'
+      'symbol_level=0'
+      'treat_warnings_as_errors=false'
+      "usb_ids_path=\"/usr/share/hwdata/usb.ids\""
+      'use_allocator="none"'
+      'use_bundled_fontconfig=false'
+      'use_cfi_icall=false' # https://crbug.com/866290
+      'use_cups=true'
+      'use_custom_libcxx=true'
+      'use_gconf=false'
+      'use_kerberos=false'
+      'use_lld=true'
+      'use_ozone=true'
+      "use_pulseaudio=${do_pa}"
+      "use_sysroot=${do_sysroot}"
+      'use_vaapi=true'
+      "use_xkbcommon=${do_wayland}"
+      "extra_cxxflags=\"${CXXFLAGS}\""
+      "extra_ldflags=\"${LDFLAGS}\""
+  )
+else
+  _chromium_conf=(
+      "enable_platform_hevc=${do_hevc}"
+      'enable_platform_ac3_eac3_audio=true'
+      'enable_platform_mpeg_h_audio=true'
+      'enable_platform_dolby_vision=true'
+      'enable_mse_mpeg2ts_stream_parser=true'
+      'enable_precompiled_headers=false'
+      'enable_swiftshader=true'
+      'fatal_linker_warnings=false'
+      "ffmpeg_branding=\"${FFMPEG_BRANDING}\""
+      "is_clang=${do_clang}"
+      'is_debug=false'
+      "is_component_build=${SHARED_FFMPEG}"
+      "is_component_ffmpeg=${SHARED_FFMPEG}"
+      "link_pulseaudio=${do_pa}"
+      "ozone_platform_wayland=${do_wayland}"
+      'proprietary_codecs=true'
+      'symbol_level=0'
+      'treat_warnings_as_errors=false'
+      'use_allocator="none"'
+      'use_bundled_fontconfig=false'
+      'use_cfi_icall=false' # https://crbug.com/866290
+      'use_cups=true'
+      'use_custom_libcxx=true'
+      #"use_custom_libcxx_for_host=${do_cust_libcxx_host}"
+      #"libcxx_natvis_include=${do_libcxx_natvis}"
+      'use_kerberos=false'
+      'use_lld=true'
+      'use_ozone=true'
+      "use_pulseaudio=${do_pa}"
+      "use_sysroot=${do_sysroot}"
+      'use_vaapi=false'
+      "use_xkbcommon=${do_wayland}"
+      "extra_cxxflags=\"${CXXFLAGS}\""
+      "extra_ldflags=\"${LDFLAGS}\""
+  )
+fi
+
 if [ ${USE_UNGOOGLED} -ne 0 ]; then
   # Add ungoogled flags if requested:
   readarray -t -O ${#_chromium_conf[@]} _chromium_conf < ${UGDIR}/flags.gn
 else
-  # Add remainder of standard chromium flags:
-  _chromium_conf+=(
-    "clang_use_chrome_plugins=${do_clang}"
-    'enable_hangout_services_extension=true'
-    "enable_hotwording=${do_hotword}"
-    'enable_js_type_check=true'
-    'enable_nacl=false'
-    'enable_nacl_nonsfi=false'
-    'enable_pepper_cdms=true'
-    "enable_widevine=${do_cdm}"
-    'exclude_unwind_tables=true'
-    'fieldtrial_testing_like_official_build=true'
-    'logging_like_official_build=true'
-  )
+  if [[ ! "$ARCH" =~ arm.* ]]; then
+    # Add remainder of standard chromium flags:
+    _chromium_conf+=(
+        "clang_use_chrome_plugins=${do_clang}"
+        'enable_hangout_services_extension=true'
+        "enable_hotwording=${do_hotword}"
+        'enable_js_type_check=true'
+        'enable_nacl=false'
+        'enable_nacl_nonsfi=false'
+        'enable_pepper_cdms=true'
+        "enable_widevine=${do_cdm}"
+        'exclude_unwind_tables=true'
+        'fieldtrial_testing_like_official_build=true'
+        'logging_like_official_build=true'
+    )
+  else
+    _chromium_conf+=(
+        "clang_use_chrome_plugins=${do_clang}"
+        'enable_hangout_services_extension=true'
+        'enable_js_type_check=true'
+        'enable_nacl=false'
+        'enable_nacl_nonsfi=false'
+        "enable_widevine=${do_cdm}"
+        'exclude_unwind_tables=true'
+        'fieldtrial_testing_like_official_build=true'
+    )
+  fi
 fi
 # Add Google API key if defined:
 if [ -n "$_google_api_key" ]; then
@@ -939,6 +1036,9 @@
 if [ "$ARCH" == "i586" ] || [ "${CROSS32}" = "YES" ]; then
   _chromium_conf=("${_chromium_conf[@]}" 'target_cpu="x86"')
 fi
+if [[ "$ARCH" =~ arm.* ]]; then
+  _chromium_conf=("${_chromium_conf[@]}" 'target_cpu="arm"' 'target_os="linux"')
+fi
 
     # Change this back when CRBUG 592268 is fixed (error during final link:
     # undefined reference to `base::i18n::GetRawIcuMemory())
@@ -1027,8 +1127,17 @@
   # Take care of Debian/Ubuntu related linker issues:
   echo "/usr/lib/${SYSROOT_TARGET}-linux-gnu/nss" >> \
     build/linux/${SYSROOTDIR}/etc/ld.so.conf.d/${SYSROOT_TARGET}-linux-gnu.conf
-  ln -s libsqlite3.so.0 \
-    build/linux/${SYSROOTDIR}/usr/lib/${SYSROOT_TARGET}-linux-gnu/libsqlite3.so
+  #ln -s libsqlite3.so.0 \
+  #  build/linux/${SYSROOTDIR}/usr/lib/${SYSROOT_TARGET}-linux-gnu/libsqlite3.so
+  # Fix path for ARM.
+  case "$ARCH" in
+    arm*)    ln -s libsqlite3.so.0 \
+             build/linux/${SYSROOTDIR}/usr/lib/${SYSROOT_TARGET}-linux-gnueabihf/libsqlite3.so
+             ;;
+    *)       ln -s libsqlite3.so.0 \
+             build/linux/${SYSROOTDIR}/usr/lib/${SYSROOT_TARGET}-linux-gnu/libsqlite3.so
+             ;;
+  esac
 fi
 
 # Do not make the build fail on stripping chromedriver,
@@ -1037,6 +1146,12 @@
   if ! file $TMP/tmp-$PRGNAM/${SRCNAM}-${VERSION}/buildtools/third_party/eu-strip/bin/eu-strip 2>/dev/null | grep -q "ELF 32-bit" ; then
     install -D -m0755 -t $TMP/tmp-$PRGNAM/${SRCNAM}-${VERSION}/buildtools/third_party/eu-strip/bin /usr/bin/eu-strip
   fi
+elif [[ "$ARCH" =~ arm.* ]]; then
+  echo "-- Make sure we have eu-strip for ARM, So we will rebuild eu-strip."
+  pushd buildtools/third_party/eu-strip
+  sh build.sh > /dev/null 2>&1 | tee $OUTPUT/eu-strip-build-${PRGNAM}.log
+  popd
+  install -D -m0755 -t $TMP/tmp-$PRGNAM/${SRCNAM}-${VERSION}/buildtools/third_party/eu-strip/bin /usr/bin/eu-strip
 fi
 
 # --- Compile --- #
@@ -1402,4 +1517,4 @@
 cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}-${PKGARCH}-${BUILD}${TAG}.txt
 
 # Restore the original umask:
-umask ${_UMASK_}
\ No newline at end of file
+umask ${_UMASK_}

Last edited by Minime_2003; 08-30-2021 at 05:03 AM.
 
1 members found this post helpful.
Old 08-30-2021, 04:42 PM   #38
Minime_2003
Member
 
Registered: Aug 2021
Location: Sweden
Distribution: Slackware
Posts: 118

Original Poster
Rep: Reputation: 39
Result so far when compiling the clang bootstrap (the python script first builds a minimum clang and lld set in order to build the llvm/clang toolchain, later used to compile chromium)
Code:
-- clang project is enabled
-- clang-tools-extra project is disabled
-- compiler-rt project is disabled
-- debuginfo-tests project is disabled
-- libc project is disabled
-- libclc project is disabled
-- libcxx project is disabled
-- libcxxabi project is disabled
-- libunwind project is disabled
-- lld project is enabled
-- lldb project is disabled
Scroll down, it shows:
Code:
-- Performing Test HAS_MAYBE_UNINITIALIZED
-- Performing Test HAS_MAYBE_UNINITIALIZED - Success
-- Native target architecture is ARM
-- 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
And targeting that was preset to X86 is now showing:
Code:
-- Linker detection: GNU ld
-- Found Git: /usr/bin/git (found version "2.31.1")
-- LLVMHello ignored -- Loadable modules not supported on this platform.
-- Targeting ARM
-- Looking for sys/resource.h
-- Looking for sys/resource.h - found
-- Clang version: 13.0.0
-- Performing Test CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG
-- Performing Test CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG - Failed
.................................
Bootstrap compiler installed.
When the bootstrap clang binaries are built, it used this to build the llvm/clang toolchain:
Code:
Building final compiler.
..........................
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- clang project is enabled
-- clang-tools-extra project is enabled
-- compiler-rt project is enabled
-- debuginfo-tests project is disabled
-- libc project is disabled
-- libclc project is disabled
-- libcxx project is disabled
-- libcxxabi project is disabled
-- libunwind project is disabled
-- lld project is enabled
-- lldb project is disabled
-- mlir project is disabled
-- openmp project is disabled
-- parallel-libs project is disabled
-- polly project is disabled
Scrolling down:
Code:
-- Performing Test SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG - Success
-- Native target architecture is ARM
-- 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: arm-slackware-linux-gnueabihf
-- Performing Test CXX_SUPPORTS_CUSTOM_LINKER
And targeting that was preset to AArch64;ARM;Mips;PowerPC;SystemZ;WebAssembly;X86 is now showing:
Code:
-- Linker detection: LLD
-- Found Git: /usr/bin/git (found version "2.31.1")
-- LLVMHello ignored -- Loadable modules not supported on this platform.
-- Targeting ARM
-- Targeting X86
-- Targeting AArch64
-- Looking for unwind.h
-- Looking for unwind.h - found
I was thinking...
If this works, it might just be easiest to create a package of the compiled llvm/clang toolchain.
Then point the buildscript to this compiled version next time one wants to compile chromium, as this would save alot of compiling time.

Last edited by Minime_2003; 08-30-2021 at 04:44 PM.
 
1 members found this post helpful.
Old 08-31-2021, 07:12 AM   #39
Minime_2003
Member
 
Registered: Aug 2021
Location: Sweden
Distribution: Slackware
Posts: 118

Original Poster
Rep: Reputation: 39
clang built ok, and it started to compile chromium with out any issues, until about line [10349] and gave same error as before "FAILED: swiftshader/libEGL.so swiftshader/libEGL.so.TOC".
So back to digging and doing some more troubleshooting.
Found out that debian/ubuntu does not use same names of their binaries...
When looking closer to the error "No such file or directory: 'arm-linux-gnueabihf-readelf'", so it cant find "arm-linux-gnueabihf-readelf".
Well no shit sherlock...slackware does not have such a binary name.
Slackware´s readelf, is just called "readelf", no more...no less...
Fixed a link to that, and tada...
The script "python3 "../../build/toolchain/gcc_solink_wrapper.py" --readelf="arm-linux-gnueabihf-readelf"..." tok that with out any complaint...
So, recompile it all again and we´ll see where the next stop hits again in about 24 hours... =)
 
1 members found this post helpful.
Old 08-31-2021, 11:20 AM   #40
Minime_2003
Member
 
Registered: Aug 2021
Location: Sweden
Distribution: Slackware
Posts: 118

Original Poster
Rep: Reputation: 39
Not 100% sure i resolved the slackbuild for arm, but i can confirm i resolved the "swiftshader/libEGL.so swiftshader/libEGL.so.TOC" error as described in post #39.

So i thought id share what i done if any one is intrested.

Here below is the diff of Alien Bob´s chromium.Slackbuild adapted for Slackware ARM-Current (SARPI).
I cant confirm i resolved all issues as i only got past "[10349/49669] SOLINK swiftshader/libEGL.so".

I am about at: [13187/49669] STAMP obj/third_party/perfetto/src/tracing/ipc/common.inputdeps.stamp at the moment.
So keeping my fingers crossed...

(Note, i have no clue what so ever if this works for aarch64 or slackware ARM 14.2.)
Code:
--- chromium.SlackBuild.orgi	2021-08-30 18:14:52.205812000 +0200
+++ chromium.SlackBuild	2021-09-02 23:59:40.034006283 +0200
@@ -409,6 +409,23 @@
 #                  * Update.
 # 92.0.4515.159-1: 17/aug/2021 by Eric Hameleers <alien@slackware.com>
 #                  * Update.
+#                  30/aug/2021 by Minime <slackware[at]slackwarelinux[dot]se
+#                  * Added lates patchset "92.0.4515.x"
+#                  * Repatched clang.toolchains.arm_i586.triple for ARM.
+#                  * Fixed chromium_conf for ARM
+#                  * Fixed target triple for arm.
+#                  * Fixed ARM sysroot path to libsqlite3.so, glibconfig.h,
+#                    dbus-arch-deps.h, graphene-config.h and incorrect
+#                    conf file "(arch)-linux-gnu.conf" in ARM system.
+#                  * Fixed compiling google's internal clang for ARM.
+#                  31/aug/2021 by Minime <slackware[at]slackwarelinux[dot]se
+#                  * Fixed missing link to debias readelf for ARM.
+#                  2/sep/2021 by Minime <slackware[at]slackwarelinux[dot]se
+#                  * Alienbob thought the code is messy, and i agree.
+#                    Started on some code cleanup.
+#                  * Removed eu-strip patch and rebuild of eu-strip as this
+#                    not needed.
+#                  * Cleaned up duplicate entries in chromium config array.
 # 
 # -----------------------------------------------------------------------------
 # 
@@ -499,6 +516,9 @@
 # (content decryption module) say "0" here.
 USE_CDM=${USE_CDM:-1}
 
+# Chromium supports VAAPI (we disable it when the platform is not capable):
+USE_VAAPI=${USE_VAAPI:-1}
+
 # If you are OK with the "OK Google" hotwording feature which will
 # automatically download a binary blob with proprietary code, set this to "1".
 # Some people object to a download without consent so it is disabled by default:
@@ -568,7 +588,7 @@
 if [ -z "$ARCH" ]; then
   case "$MARCH" in
     i?86)    export ARCH=i586 ;;
-    armv7hl) export ARCH=$MARCH ;;
+    armv7*) export ARCH=$MARCH ;;
     armv6hl) export ARCH=$MARCH ;;
     arm*)    export ARCH=arm ;;
     # Unless $ARCH is already set, use uname -m for all other archs:
@@ -583,7 +603,7 @@
              DSSE="1"
              FFMPEG_ARCH="ia32"
              SYSROOT_ARCH="i386"
-             SYSROOT_TARGET="i386"
+             SYSROOT_TARGET="i386-linux-gnu"
              PKGARCH="$ARCH"
              ;;
   x86_64)    # Ensure that 32bit libraries are found first if we cross-compile:
@@ -592,36 +612,42 @@
                SLKLDFLAGS="-L/usr/lib"; LIBDIRSUFFIX=""
                FFMPEG_ARCH="ia32"
                SYSROOT_ARCH="i386"
-               SYSROOT_TARGET="i386"
+               SYSROOT_TARGET="i386-linux-gnu"
                PKGARCH="i586"
              else
                SLKCFLAGS="-O2 -fPIC"
                SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64"
                FFMPEG_ARCH="x64"
                SYSROOT_ARCH="amd64"
-               SYSROOT_TARGET="x86_64"
+               SYSROOT_TARGET="x86_64-linux-gnu"
                PKGARCH="$ARCH"
              fi
              #DSSE="0"
              DSSE="1"
              ;;
-  armv7hl)   SLKCFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16"
-             SLKLDFLAGS=""; LIBDIRSUFFIX=""
+  armv7*)    SLKCFLAGS="-O2 -march=armv7-a -mtune=cortex-a72 -mfpu=vfpv3-d16 -mfloat-abi=hard"
+             #SLKLDFLAGS=""; LIBDIRSUFFIX=""
+             SLKLDFLAGS="-Wl,-z,notext"; LIBDIRSUFFIX=""
              DSSE="1"
              # Widevine not supported (no binary library available):
              USE_CDM=0
+             # VAAPI not supported:
+             USE_VAAPI=0
              FFMPEG_ARCH="arm"
              SYSROOT_ARCH="arm"
-             SYSROOT_TARGET="arm"
+             SYSROOT_TARGET="arm-linux-gnueabihf"
              PKGARCH="$ARCH"
              ;;
   armv6hl)   SLKCFLAGS="-O2 -march=armv6 -mfpu=vfp -mfloat-abi=hard"
-             SLKLDFLAGS=""; LIBDIRSUFFIX=""
+             #SLKLDFLAGS=""; LIBDIRSUFFIX=""
+             SLKLDFLAGS="-Wl,-z,notext"; LIBDIRSUFFIX=""
              DSSE="1"
              # Widevine not supported (no binary library available):
              USE_CDM=0
+             # VAAPI not supported:
+             USE_VAAPI=0
              FFMPEG_ARCH="arm"
-             SYSROOT_ARCH="arm"
+             SYSROOT_TARGET="arm-linux-gnueabihf"
              SYSROOT_TARGET="arm"
              PKGARCH="$ARCH"
              ;;
@@ -632,13 +658,13 @@
              USE_CDM=0
              FFMPEG_ARCH="$ARCH"
              SYSROOT_ARCH="$ARCH"
-             SYSROOT_TARGET="$ARCH"
+             SYSROOT_TARGET="$ARCH-linux-gnu"
              PKGARCH="$ARCH"
              ;;
 esac
 
 case "$ARCH" in
-    arm*)    TARGET=$ARCH-slackware-linux-gnueabi ;;
+    arm*)    TARGET=$SYSROOT_ARCH-slackware-linux-gnueabihf ;;
     *)       TARGET=$ARCH-slackware-linux ;;
 esac
 
@@ -750,6 +776,37 @@
 # Be compatible with gcc 10:
 cat $SRCDIR/patches/chromium_gcc10.patch | patch -p1 --verbose \
   2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log
+
+  # Latest patchsets for chromium-92.0.4515.x
+# Fixes for building with libstdc++ instead of libc++
+cat $SRCDIR/patches/chromium-90-ruy-include.patch \
+  | patch -p1 --verbose 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log
+cat $SRCDIR/patches/chromium-78-protobuf-RepeatedPtrField-export.patch \
+  | patch -p1 --verbose 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log
+# Disable various compiler configs
+#cat $SRCDIR/patches/chromium-91-compiler.patch \
+#  | patch -p1 --verbose 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log
+cat $SRCDIR/patches/chromium-swiftshader-export.patch \
+  | patch -p1 --verbose 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log
+# GCC: make VRegister::from_code() constexpr on aarch64
+# On arm64 you need to update bundled third_party/highway to 0.12.1
+# and append -flax-vector-conversions to your CXXFLAGS.
+cat $SRCDIR/patches/chromium-92-v8-constexpr.patch \
+  | patch -p1 --verbose 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log
+# Additional patch for chromium-91 (arm64 only)
+cat $SRCDIR/patches/chromium-91-libyuv-aarch64.patch \
+  | patch -p1 --verbose 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log
+
+# Arch Chromium patches and New google patches.
+# Fixes widevine support for arm
+cat $SRCDIR/patches/0001-widevine-support-for-arm.patch \
+  | patch -p1 --verbose 2>&1 | tee -a $OUTPUT/arch_patch-${PRGNAM}.log
+
+# Third party patches
+# Fixes harfbuzz-ng unused variable `supp_size` from plan_subset_encoding(...)
+cat $SRCDIR/patches/fix-harfbuzz-supp-size.patch \
+  | patch -p1 --verbose 2>&1 | tee -a $OUTPUT/arch_patch-${PRGNAM}.log
+
 # Fix the link on 32bit:
 sed -e '/ldflags /s/-m32/&", "-Wl,-z,notext/' \
   -i build/config/compiler/BUILD.gn
@@ -760,7 +817,8 @@
 # Slackware specific:
 # When compiling google's clang on 32bit Slackware use 'i586' in the triplet.
 # I am a python noob so this is clumsy, better implementation is welcome :-)
-cp $SRCDIR/patches/clang.toolchains.i586.triple.diff .
+#cp $SRCDIR/patches/clang.toolchains.i586.triple.diff .
+cp $SRCDIR/patches/clang.toolchains.arm_i586.triple.diff .
 cat $SRCDIR/patches/chromium_32bit_triplet.patch | patch -p1 --verbose \
   2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log
 # Don't crap out when gzip does not support '--rsyncable' (Slackware < 14.2):
@@ -803,6 +861,16 @@
 # And fix the 32bit compilation while we are at it:
 sed -i tools/clang/scripts/build.py -e "s/ldflags = \[\]/ldflags = \['-latomic'\]/"
 
+# If ARM, then try to force the build script to build clang for arm instead of x86
+if [[ "$ARCH" =~ arm.* ]]; then
+  # We are compiling bootstrap for ARM and not X86.
+  sed -i tools/clang/scripts/build.py -e "s/bootstrap_targets = \x27X86\x27/bootstrap_targets = \x27ARM\x27/"
+  # We are using ARM, so to speed things up we only build the relevant back-ends
+  # (ARM,AArch64 and x86), since it’s very unlikely that we will cross-compile to other arches.
+  # x86 is allso needed for Compiler-RT tests.
+  sed -i tools/clang/scripts/build.py -e "s/targets = \x27AArch64;ARM;Mips;PowerPC;SystemZ;WebAssembly;X86\x27/targets = \x27ARM;X86;AArch64\x27/"
+fi
+
 # When compiling google's clang, use the system cmake
 # (prebuilt binary from google is only available as 64bit):
 sed -i tools/clang/scripts/build.py -e 's/^ *AddCMakeToPath/#&/'
@@ -861,7 +929,6 @@
 # "./out/Release/gn args out/Release --list"
 # for a list of all variables.
 _chromium_conf=(
-    'enable_hidpi=true'
     "enable_platform_hevc=${do_hevc}"
     'enable_platform_ac3_eac3_audio=true'
     'enable_platform_mpeg_h_audio=true'
@@ -869,7 +936,6 @@
     'enable_mse_mpeg2ts_stream_parser=true'
     'enable_precompiled_headers=false'
     'enable_swiftshader=true'
-    'enable_webrtc=true'
     'fatal_linker_warnings=false'
     "ffmpeg_branding=\"${FFMPEG_BRANDING}\""
     "is_clang=${do_clang}"
@@ -877,53 +943,64 @@
     "is_component_build=${SHARED_FFMPEG}"
     "is_component_ffmpeg=${SHARED_FFMPEG}"
     "link_pulseaudio=${do_pa}"
-    "linux_sandbox_path=\"/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/chrome_sandbox\""
-    #'linux_strip_binary=true'
-    'linux_use_bundled_binutils=false'
-    "ozone_platform_wayland=${do_wayland}"
     #"rtc_use_pipewire=${do_wayland}"
     #"rtc_link_pipewire=${do_wayland}"
     #'rtc_pipewire_version="0.3"' # Otherwise chromium tries to link absent 0.2 
+    "ozone_platform_wayland=${do_wayland}"
     'proprietary_codecs=true'
-    'remove_webcore_debug_symbols=true'
     'symbol_level=0'
     'treat_warnings_as_errors=false'
-    "usb_ids_path=\"/usr/share/hwdata/usb.ids\""
     'use_allocator="none"'
     'use_bundled_fontconfig=false'
     'use_cfi_icall=false' # https://crbug.com/866290
     'use_cups=true'
     'use_custom_libcxx=true'
-    'use_gconf=false'
     'use_kerberos=false'
     'use_lld=true'
     'use_ozone=true'
     "use_pulseaudio=${do_pa}"
     "use_sysroot=${do_sysroot}"
-    'use_vaapi=true'
+    "use_vaapi=${USE_VAAPI}"
     "use_xkbcommon=${do_wayland}"
     "extra_cxxflags=\"${CXXFLAGS}\""
     "extra_ldflags=\"${LDFLAGS}\""
 )
+if [[ ! "$ARCH" =~ arm.* ]]; then
+  _chromium_conf+=(
+      'enable_hidpi=true'
+      'enable_webrtc=true'
+      "linux_sandbox_path=\"/usr/lib${LIBDIRSUFFIX}/${PRGNAM}/chrome_sandbox\""
+      #'linux_strip_binary=true'
+      'linux_use_bundled_binutils=false'
+      'remove_webcore_debug_symbols=true'
+      "usb_ids_path=\"/usr/share/hwdata/usb.ids\""
+      'use_gconf=false'
+  )
+fi
+
 if [ ${USE_UNGOOGLED} -ne 0 ]; then
   # Add ungoogled flags if requested:
   readarray -t -O ${#_chromium_conf[@]} _chromium_conf < ${UGDIR}/flags.gn
 else
-  # Add remainder of standard chromium flags:
+  if [[ ! "$ARCH" =~ arm.* ]]; then
+    # Add remainder of standard chromium flags:
+    _chromium_conf+=(
+        "enable_hotwording=${do_hotword}"
+        'enable_pepper_cdms=true'
+    )
+  fi
   _chromium_conf+=(
-    "clang_use_chrome_plugins=${do_clang}"
-    'enable_hangout_services_extension=true'
-    "enable_hotwording=${do_hotword}"
-    'enable_js_type_check=true'
-    'enable_nacl=false'
-    'enable_nacl_nonsfi=false'
-    'enable_pepper_cdms=true'
-    "enable_widevine=${do_cdm}"
-    'exclude_unwind_tables=true'
-    'fieldtrial_testing_like_official_build=true'
-    'logging_like_official_build=true'
+      "clang_use_chrome_plugins=${do_clang}"
+      'enable_hangout_services_extension=true'
+      'enable_js_type_check=true'
+      'enable_nacl=false'
+      'enable_nacl_nonsfi=false'
+      "enable_widevine=${do_cdm}"
+      'exclude_unwind_tables=true'
+      'fieldtrial_testing_like_official_build=true'
   )
 fi
+
 # Add Google API key if defined:
 if [ -n "$_google_api_key" ]; then
   _chromium_conf+=(
@@ -939,6 +1016,9 @@
 if [ "$ARCH" == "i586" ] || [ "${CROSS32}" = "YES" ]; then
   _chromium_conf=("${_chromium_conf[@]}" 'target_cpu="x86"')
 fi
+if [[ "$ARCH" =~ arm.* ]]; then
+  _chromium_conf=("${_chromium_conf[@]}" 'target_cpu="arm"' 'target_os="linux"')
+fi
 
     # Change this back when CRBUG 592268 is fixed (error during final link:
     # undefined reference to `base::i18n::GetRawIcuMemory())
@@ -1017,24 +1097,31 @@
   # Take care of Debian/Ubuntu related missing header issues:
   SYSROOTDIR=$(basename $(ls build/linux/ |grep ${SYSROOT_ARCH}-sysroot))
 
-  ln -s ../../lib/${SYSROOT_TARGET}-linux-gnu/glib-2.0/include/glibconfig.h \
+  ln -s ../../lib/${SYSROOT_TARGET}/glib-2.0/include/glibconfig.h \
     build/linux/${SYSROOTDIR}/usr/include/glib-2.0/glibconfig.h
-  ln -s ../../../lib/${SYSROOT_TARGET}-linux-gnu/dbus-1.0/include/dbus/dbus-arch-deps.h \
+  ln -s ../../../lib/${SYSROOT_TARGET}/dbus-1.0/include/dbus/dbus-arch-deps.h \
     build/linux/${SYSROOTDIR}/usr/include/dbus-1.0/dbus/dbus-arch-deps.h
-  ln -s ../../lib/${SYSROOT_TARGET}-linux-gnu/graphene-1.0/include/graphene-config.h \
+  ln -s ../../lib/${SYSROOT_TARGET}/graphene-1.0/include/graphene-config.h \
     build/linux/${SYSROOTDIR}/usr/include/graphene-1.0/graphene-config.h
 
   # Take care of Debian/Ubuntu related linker issues:
-  echo "/usr/lib/${SYSROOT_TARGET}-linux-gnu/nss" >> \
-    build/linux/${SYSROOTDIR}/etc/ld.so.conf.d/${SYSROOT_TARGET}-linux-gnu.conf
+  echo "/usr/lib/${SYSROOT_TARGET}/nss" >> \
+    build/linux/${SYSROOTDIR}/etc/ld.so.conf.d/${SYSROOT_TARGET}.conf
   ln -s libsqlite3.so.0 \
-    build/linux/${SYSROOTDIR}/usr/lib/${SYSROOT_TARGET}-linux-gnu/libsqlite3.so
+    build/linux/${SYSROOTDIR}/usr/lib/${SYSROOT_TARGET}/libsqlite3.so
+
+  # The platform-specific alias for the ARM readelf binary is missing
+  # from the debian sysroot image:
+  if [ ! -f build/linux/${SYSROOTDIR}/usr/bin/${SYSROOT_TARGET}-readelf ]; then
+    ln -s /usr/bin/readelf \
+      build/linux/${SYSROOTDIR}/usr/bin/${SYSROOT_TARGET}-readelf
+  fi
 fi
 
 # Do not make the build fail on stripping chromedriver,
-# because Chromium installs a 64bit version of eu-strip on the 32bit OS:
-if [ "$ARCH" == "i586" ]; then
-  if ! file $TMP/tmp-$PRGNAM/${SRCNAM}-${VERSION}/buildtools/third_party/eu-strip/bin/eu-strip 2>/dev/null | grep -q "ELF 32-bit" ; then
+# because Chromium installs a 64bit version of eu-strip on the 32bit & ARM OS:
+if [ "$ARCH" != "x86_64" ]; then
+  if file $TMP/tmp-$PRGNAM/${SRCNAM}-${VERSION}/buildtools/third_party/eu-strip/bin/eu-strip 2>/dev/null | grep -q "ELF 64-bit" ; then
     install -D -m0755 -t $TMP/tmp-$PRGNAM/${SRCNAM}-${VERSION}/buildtools/third_party/eu-strip/bin /usr/bin/eu-strip
   fi
 fi
@@ -1402,4 +1489,4 @@
 cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}-${PKGARCH}-${BUILD}${TAG}.txt
 
 # Restore the original umask:
-umask ${_UMASK_}
\ Ingen nyrad vid filslut
+umask ${_UMASK_}
Will be adding this and the patchset´s to my github.

Edit:
Updated the patch/diff both in this comment and on my github.
As far as i can see it should build without any issues, if you run the script and get any errors or issues please give me a nudge.

Last edited by Minime_2003; 09-02-2021 at 06:31 PM.
 
Old 08-31-2021, 02:43 PM   #41
Minime_2003
Member
 
Registered: Aug 2021
Location: Sweden
Distribution: Slackware
Posts: 118

Original Poster
Rep: Reputation: 39
@Exaga
Many thanks to you for all the support, encouragement, words of wisdom, the tips for moving forward and solving this puzzle, it has really helped me along the way.
I take my hat off to you.

@Alien Bob
I doubt that I would have managed to pull this off and solve this if it weren't for your eminence and brilliant build scripts.
I am truly amazed by all the work you done.
Likewise, I take my hat off to you.

Last edited by Minime_2003; 08-31-2021 at 02:52 PM.
 
Old 09-20-2021, 04:16 PM   #42
Minime_2003
Member
 
Registered: Aug 2021
Location: Sweden
Distribution: Slackware
Posts: 118

Original Poster
Rep: Reputation: 39
I have added compiled Slackware ARM packages chromium-92.0.4515.159 and chromium-ungoogled-92.0.4515.159 to my github you can download and install.
The chromium packages are patched to support widevine for ARM and tested with Widevine 4.10.2252.0.
Note you will also have to install my patched Slackware ARM glibc packages to make latest Widevine 4.10.2252.0 to work.
 
Old 09-27-2021, 01:29 AM   #43
Minime_2003
Member
 
Registered: Aug 2021
Location: Sweden
Distribution: Slackware
Posts: 118

Original Poster
Rep: Reputation: 39
I have added compiled Slackware ARM package chromium-93.0.4577.82 and chromium-ungoogled-93.0.4577.82 to my github you can download and install.
The chromium packages are patched to support widevine for ARM and tested with Widevine 4.10.2252.0.
Note you will also have to install my patched Slackware ARM glibc packages to make the latest Widevine 4.10.2252.0 to work.

Last edited by Minime_2003; 10-04-2021 at 09:21 AM.
 
1 members found this post helpful.
Old 01-11-2022, 08:03 AM   #44
Minime_2003
Member
 
Registered: Aug 2021
Location: Sweden
Distribution: Slackware
Posts: 118

Original Poster
Rep: Reputation: 39
I have added compiled Slackware ARM package chromium-ungoogled-97.0.4692.71 to my github you can download and install.

I have not compiled chromium-97.0.4692.71 package due to the time it takes to compile (Compile time is about forty eight hours) and as i only use the ungoogled version for my personal use, i have not bothered to compile the chromium version.
The build script can be found on my git hub if you want to compile it your self.

The chromium package is patched to support widevine for ARM and tested with Widevine 4.10.2252.5.
Note you will also have to install my patched Slackware ARM glibc packages to make the latest Widevine 4.10.2252.5 to work.

Last edited by Minime_2003; 01-11-2022 at 08:06 AM.
 
  


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 01:34 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