#With Clang!
1 messages · Page 1 of 1 (latest)
ty ty!
Noice
:)
Same..
Sure if the power doesn't go out again...
:P
I'll be almost done with the btrfs, luks Gentoo installation 😰
exciting! i'm actually redoing my isntall atm
moving from zfs to btrfs
never heard of zfs
ohh its an out of tree fs
similar to btrfs in some regards
my zfs list
yea it is
but its out of tree so its a bit annoying
here is the one i'm moving to atm
Why did you use BTRFS in the first place?
no i used zfs, just i'm moving to btrfs :)
i made my own stage 3 today
oh i forgot to put my make.conf in here
with clang!
I meant why did you use ZFS in the first place
:P
ohhhh because of raid
i didnt know about mdadm and i wanted to raid
so i used zfs!
as btrfs raid can be a bit dodge
Oh ok
yea
I'm taking a look at it
:)
I'm wondering if my BTRFS filesystems compress themselves automatically
Oh now I understand the difference between them
yea
heh
Well anyways, good luck with it, I didn't know we were able to create our own stage 3
Really interesting
:P quite simpel
:P
dream for -j352 smh
and it's one Ryzen here :D
@gleaming topaz i'm movin to -j80 next week
x86?
yep
when llvm will see -j80 it will compile in a sec
with lto it takes llvm
they pack a punch for how energy efficient they are
[rahulsandhu@zworkstation ~]$ qlop -v sys-devel/llvm
2023-06-11T03:02:17 >>> sys-devel/llvm-16.0.5: 10′42″
:D
I'm too scared to use lto,pgo,-O3 whatever
:P it takes i think 10 mintues llvm,
only use -O3 with clang ;)
lemme check here
[rahulsandhu@zworkstation /]$ qlop -v sys-devel/clang
2023-06-11T04:47:54 >>> sys-devel/clang-16.0.5: 9′30″
for me the reason it takes that long is probably because of swap
I shouldn't use -j12
get more ram
ddr4 is cheap rn
do it until they stop making ddr4 then it will go up again
Yeah I'm planning on getting 32GB of ram
:)
since it's the max of this laptop
[rahulsandhu@zworkstation ~]$ free -mh
total used free shared buff/cache available
Mem: 220Gi 15Gi 200Gi 487Mi 4.3Gi 202Gi
Swap: 0B 0B 0B```
well I would definitely compile qtwebengine with lto,pgo,-O3 on that machine
on my no no
:P
5 hours is enough for me
:D
:D
I should really reconsider using gentoo for more than a week
it's just too fun not to use
:P
been using gentoo since this february and have no reason not to use anything else
I mean I could probably use Gentoo and enable ccache
it did make nodejs drop from 35 minutes to 5
posted it
do you share the dotfile?
i second this, grabbing sway right now and that bar looks really good
if you don't mind can you ping me when you do
if you don't mind me asking what's -mtune=native
its me being paranoid :D
basically
its set by -march
oh, also I see you're "enforcing" lto?
Me playing it safe with USE="lto pgo" (yes I finally decided to give them a try lmfao)
Mon Jul 17 10:05:57 2023 >>> sys-devel/gcc-12.3.1_p20230526
merge time: 48 minutes and 24 seconds.
Wed Jul 19 07:50:41 2023 >>> sys-devel/gcc-12.3.1_p20230526
merge time: 2 hours, 11 minutes and 15 seconds.``` still worth it 
LMAOOOOOOOOOOOOOOOOOOOOOO
I'm kinda thinking about making llvm compile with clang
since it takes less to compile with clang
than with gcc
I could do the gcc-compile env, but in reverse
rather than gcc it would be clang
and I could select what packages I want to compile with clang
yea
Well I forgot the content of that file since the thread in r/unixporn takes a while to load
CXX="clang++"
AR="llvm-ar"
NM="llvm-nm"
RANLIB="llvm-ranlib"
OBJCOPY="llvm-objcopy"
OBJDUMP="llvm-objdump"
``` I know I would need these
who knows maybe if all my packages will compile fine I will do it in reverse again
:D
ohhhh fun
Gentoo is already fun, but why not make it even more fun!
:D
:D
For fun I enabled ~amd64 globally and then I saw how many packages it wanted to update :D
more than 100
Ay I did it I moved my gentoo make.conf to clang!
do you flto=thin during install or after?
So I make my own stage4's, but following the "traditional" stage 3 route, I would:
- Extract stage3 and chroot
- Set locale and timezone
- env-update && source /etc/profile && export PS1="(chroot) ${PS1}"
- emerge --sync && emerge -av1 sys-apps/merge-usr && merge-usr && emerge -c sys-apps/merge-usr # for systemd only
- switch profile, to systemd + desktop + merged-usr # note no llvm/clang profile there
- emerge -va sys-devel/clang sys-devel/llvm sys-libs/llvm-libunwind sys-devel/lld
- emerge -va1 sys-devel/clang-common sys-devel/llvm-common
- env-update && source /etc/profile && export PS1="(chroot) ${PS1}"
- set my custom make.conf then, followed by an emerge -e @world
- finish rest of install and reboot
do you make your stage4 with catalyst?
Note that the -va is redundant for my case as I have EMERGE_DEFAULT_OPTS="--ask --ask-enter-invalid --keep-going --verbose" set in my make.conf
ahh i see
then use mkstage4
how's your experiene been with clang
Fairly good, it works well, I like it
Plan to stick with it
I use it on all my boxes
currently in the middle of doing h/selinux but might switch to clang
(Router, Firewall, Server, Desktop, Laptop, TV Box, Raspberry Pi)
ahhhhh fun
i made a custom profile for hardneed
i tried llvm/systemd earlier but gcc and glibc kept failing to compile for some reason
ahhh there was a bug iirc
fixed now
also that reminds me
let me upload my dots
I got my server setup again
ahh right
i lost the logs because i decided to wipe the disk and give up earlier, but it was something along the lines of some files being different or something?
yep i had that issue
yea it was a gcc one iirc
it got fixed :)
it was just a bug
one day it just worked lmao
it was literally just last night
oh
that i tried doing it
in that case i would suggest filing a gentoo bug
as this happened like a month and a half ago for me
clang/systemd or I'm confusing something here?
yeaa
i have a habit of using clang and llvm interchangeably haha
I don't think systemd was fixing with clang, but gcc and glibc failing is a sign that you set something wrong
because I just compiled gcc 13.1 with Clang
yeah, i tried it twice, first time it was with -flto=thin
thankss
np
clone command would be ssh://[email protected]/git/configs/dotfiles.git
oh wait no you guys don't have access
it would be git clone https://anongit.sandhuservices.dev/configs/dotfiles.git
I'm only using USE='lto pgo" soo I think cow will be able to help you much more
when it comes to lto or pgo, I'm kinda green 
i'll try using only those flags
my current make.conf is
are you supposed to use -flto from the start or is that something you add once the system boots?
neither
i just setup the timezone and keyboard layout
and hostname and systemd-firstboot shit
then i just get clang lld and llvm and stuff installed
update the enviroment
THEN switch to lto
also don't use it with the kernel
with the kernel i use
[rahulsandhu@zworkstation ~/Development/dotfiles]$ cat /etc/portage/package.env/package.env | grep -i "kernel"
sys-kernel/gentoo-kernel clang-plain
wouldn't that break?
wrong message
oh lmao
kernel with lto
i'm going to destroy my zpool real quick brb
yea it would break
[rahulsandhu@zworkstation ~/Development/dotfiles]$ cat /etc/portage/env/clang-plain
COMMON_FLAGS="-march=native -mtune=native -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
it is supposed to ignore all lto, but it doesnt even compile
due to a bug
does genkernel work with clang?
i tried genkernel with clang and musl and it broke, and i wasn't sure if it's clang's fault or musl's fault
ahh i see
isn't genkernel used for gentoo-sources?
nononon gekernel is a seperate thing
it does both kernel and initramfs
(but not with installkernel)
you can --menuconfig all
@little merlin no thats genkernel
sys-kernel/genkernel pulls it in
but sys-kernel/gentoo-sources does not EXPLICTLY use tit
you can do that without genkernel make menuconfig
^
hmm so would doing make menuconfig and dracut be better than genkernel
if i need to tweak the kernel
use the dist kernel
working fine
and use a custom kernel with it
i use a custom kernel with my dist kernel
to do it:
I'm using gentoo-kernel + custom name(thanks to Cow!)
first up apply the use flag 'savedconfig' to sys-kernel/gentoo-kernel
i like compiling kernel because it lets me use selinux without kernel parameters
then you simple do mkdir -pv /etc/portage/savedconfig/sys-kernel/
i mean i'm doing clang rn but
no but dist is compiled from source
thinking of combining clang with hardened/selinux in the future
there are 2 dist kernels
sys-kernel/gentoo-kernel is the one compiled from source
that also supports a custom config
sys-kernel/gentoo-kernel-bin is the binary one
oh so you can do menuconfig on the dist kernel?
sort of
you do menuconfig in a different place
then set the use flag 'savedconfig' on sys-kernel/gentoo-kernel
then you mkdir -pv /etc/portage/savedconfig/sys-kernel
then you cp your kernel config with say cp .config /etc/portage/savedconfig/sys-kernel/gentoo-kernel
to get the gentoo sources you would do
ebuild /var/db/repos/gentoo/sys-kernel/gentoo-sources/gentoo-sources-6.4.4.ebuild clean install
but use the dist kernel
nononono
so you do
ebuild /var/db/repos/gentoo/sys-kernel/gentoo-sources/gentoo-sources-6.4.4.ebuild clean install
ahh i see
then it will be in /var/tmp/portage/sys-kernel/gentoo-source-6.4.4/work/
then you just copy that to ~/
chown $USER: ~/kernel_dir_name
then you just cd into it, make menuconfig -j64
then you just cp .config /etc/portage/savedconfig/sys-kernel/gentoo-kernel
what cpu has that many cores goddamn
threadripper?
also out of curiosity do you use the systemd version or openrc version of llvm
*stage tarball
2 xeon's!
dual cpu :P
systemd normal tarball
why?
so do i do systemd normal and switch to llvm profile?
or
wait is the llvm profile not something i'm supposed to use
no llvm profile
no you should stay on the normal profile
instead you add
COMMON_FLAGS="-march=native -mtune=native -O3 -pipe"
CFLAGS="${COMMON_FLAGS} -flto=thin"
CXXFLAGS="${COMMON_FLAGS} -flto=thin"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"
CC="clang"
CXX="clang++"
AR="llvm-ar"
NM="llvm-nm"
RANLIB="llvm-ranlib"
OBJCOPY="llvm-objcopy"
OBJDUMP="llvm-objdump"
LDFLAGS="${LDFLAGS} -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,--as-needed"
to your make.conf
but most things work great under the llvm profile though
i've tried once before to clang-ify my normal install
i had to manually add a lot of stuff to package.env
to use gcc
before or after emerging world?
if i don't need to use llvm profile maybe i can pair this up with hardened/selinux?
except for gcc and glibc
yep
also note you can use a custom profile
i create a custom one
for hardened
oh so you basically just made your own version of the hardened profile?
yea
that has nothing to do with clang/llvm?
yea basically
is this good?
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
COMMON_FLAGS="-march=native -mtune=native -O2 -pipe"
CFLAGS="${COMMON_FLAGS} -flto=thin"
CXXFLAGS="${COMMON_FLAGS} -flto=thin"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"
MAKEOPTS="-j17"
EMERGE_DEFAULT_OPTS="--keep-going --ask-enter-invalid --jobs=17 --load-average=17 --with-bdeps y --complete-graph y"
FEATURES="binpkg-logs buildpkg cgroup downgrade-backup ipc-sandbox network-sandbox parallel-fetch parallel-install sign"
CC="clang"
CXX="clang++"
AR="llvm-ar"
NM="llvm-nm"
RANLIB="llvm-ranlib"
OBJCOPY="llvm-objcopy"
OBJDUMP="llvm-objdump"
LDFLAGS="${LDFLAGS} -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,--as-needed"
ACCEPT_KEYWORDS="~amd64"
ACCEPT_LICENSE="*"
USE="lvm luks lto pgo elogind dbus gui hardened X xwayland wayland"
USE="${USE} -telemetry -systemd -gnome -kde -branding"
# NOTE: This stage was built with the bindist Use flag enabled
# This sets the language of build output to English.
# Please keep this setting intact when reporting bugs.
LC_MESSAGES=C.utf8
GRUB_PLATFORMS="efi-64"
# SELinux stuff
POLICY_TYPES="strict targeted"
VIDEO_CARDS="amdgpu radeonsi"
INPUT_DEVICES="libinput"
CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3"
wait
let me look through
one minute
@little merlin
USE="lvm luks lto pgo elogind dbus gui hardened X xwayland wayland"
USE="${USE} -telemetry -systemd -gnome -kde -branding"
don't do that
if you want to make the line shorter
do
USE="lvm luks lto pgo elogind dbus gui hardened X xwayland wayland
-telemetry -systemd -gnome -kde -branding"
yes
thankss

