#With Clang!

1 messages · Page 1 of 1 (latest)

olive orbit
#

Really comfy, nice bar!

gaunt shoal
steel sail
#

Noice

gaunt shoal
#

:)

steel sail
#

I need to post mine but havent finished it yet

#

Its basically just evolution

gaunt shoal
#

ohh exciting!

#

ping me when ya do

olive orbit
#

Same..

steel sail
#

Sure if the power doesn't go out again...

gaunt shoal
#

:P

olive orbit
#

I'll be almost done with the btrfs, luks Gentoo installation 😰

gaunt shoal
#

moving from zfs to btrfs

olive orbit
#

never heard of zfs

gaunt shoal
#

similar to btrfs in some regards

#

my zfs list

olive orbit
#

Oh you're right

#

That's very similar

gaunt shoal
#

yea it is

#

but its out of tree so its a bit annoying

#

here is the one i'm moving to atm

olive orbit
#

Why did you use BTRFS in the first place?

gaunt shoal
#

i made my own stage 3 today

#

oh i forgot to put my make.conf in here

olive orbit
#

wait..

#

I'm so sleepy

gaunt shoal
#

with clang!

olive orbit
#

I meant why did you use ZFS in the first place

gaunt shoal
gaunt shoal
#

i didnt know about mdadm and i wanted to raid

#

so i used zfs!

#

as btrfs raid can be a bit dodge

olive orbit
#

Oh ok

gaunt shoal
#

yea

olive orbit
#

I'm taking a look at it

gaunt shoal
#

:)

olive orbit
#

I'm wondering if my BTRFS filesystems compress themselves automatically

#

Oh now I understand the difference between them

gaunt shoal
#

yea

olive orbit
#

Yeah I was a bit worried if I missed a command for compressing my filesystems

gaunt shoal
#

heh

olive orbit
#

Well anyways, good luck with it, I didn't know we were able to create our own stage 3

#

Really interesting

olive orbit
#

I might as well do the same for a possible future installation

#

Great then!

gaunt shoal
#

:P

gleaming topaz
#

Love it

#

-j64 my dream ;-;

steel sail
gleaming topaz
#

nah -j456

#

anyway back to updating llvm

gaunt shoal
#

its 2 xeons

gleaming topaz
#

and it's one Ryzen here :D

gaunt shoal
#

@gleaming topaz i'm movin to -j80 next week

gleaming topaz
#

._.

#

damn

gaunt shoal
#

:P

#

ryzens are nice

gaunt shoal
gleaming topaz
#

when llvm will see -j80 it will compile in a sec

gaunt shoal
steel sail
gaunt shoal
#

[rahulsandhu@zworkstation ~]$ qlop -v sys-devel/llvm
2023-06-11T03:02:17 >>> sys-devel/llvm-16.0.5: 10′42″

gleaming topaz
gaunt shoal
steel sail
#

only use -O3 with clang ;)

gaunt shoal
#

:)

#

yup

gleaming topaz
#

44 minutes here with clang

#

58 minutes with GCC

gaunt shoal
#

lemme check here

steel sail
#

ryzen

gaunt shoal
gleaming topaz
#

for me the reason it takes that long is probably because of swap

#

I shouldn't use -j12

steel sail
#

get more ram
ddr4 is cheap rn

#

do it until they stop making ddr4 then it will go up again

gleaming topaz
#

Yeah I'm planning on getting 32GB of ram

steel sail
#

nice

#

i got 32gb myself

gaunt shoal
#

:)

gleaming topaz
#

since it's the max of this laptop

gaunt shoal
#
[rahulsandhu@zworkstation ~]$ free -mh
               total        used        free      shared  buff/cache   available
Mem:           220Gi        15Gi       200Gi       487Mi       4.3Gi       202Gi
Swap:             0B          0B          0B```
gleaming topaz
#

well I would definitely compile qtwebengine with lto,pgo,-O3 on that machine

#

on my no no

gaunt shoal
#

:P

gleaming topaz
#

5 hours is enough for me

gaunt shoal
#

:D

gleaming topaz
#

:D

#

I should really reconsider using gentoo for more than a week

#

it's just too fun not to use

gaunt shoal
#

:P

gleaming topaz
#

:P

#

but installation takes a while

#

especially with plasma

steel sail
#

been using gentoo since this february and have no reason not to use anything else

gleaming topaz
#

I mean I could probably use Gentoo and enable ccache

#

it did make nodejs drop from 35 minutes to 5

steel sail
drowsy frigate
#

do you share the dotfile?

little merlin
gaunt shoal
#

:) ty ty, i'll upload it when I get back from school

#

i'll put it in a git repo

little merlin
#

if you don't mind can you ping me when you do

gleaming topaz
#

if you don't mind me asking what's -mtune=native

gaunt shoal
#

basically

#

its set by -march

gleaming topaz
#

oh, also I see you're "enforcing" lto?

gaunt shoal
#

yea

#

flto=thin is basically thin lto

gleaming topaz
#

Me playing it safe with USE="lto pgo" (yes I finally decided to give them a try lmfao)

gaunt shoal
#

LMAO

#

:D

gleaming topaz
#

     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 ![simd](https://cdn.discordapp.com/emojis/1013515285300510801.webp?size=128 "simd")
gaunt shoal
#

LMAOOOOOOOOOOOOOOOOOOOOOO

gleaming topaz
#

I'm kinda thinking about making llvm compile with clang

#

since it takes less to compile with clang

#

than with gcc

gaunt shoal
#

its a possibility

#

fairly easy to do :)

gleaming topaz
#

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

gaunt shoal
#

yea

gleaming topaz
#

Well I forgot the content of that file since the thread in r/unixporn takes a while to load

gaunt shoal
#

lmao let me make it for you

#

one min

gleaming topaz
#
CXX="clang++"
AR="llvm-ar"
NM="llvm-nm"
RANLIB="llvm-ranlib"
OBJCOPY="llvm-objcopy"
OBJDUMP="llvm-objdump"
``` I know I would need these
gaunt shoal
#

yep!

#

a few more too

gleaming topaz
#

who knows maybe if all my packages will compile fine I will do it in reverse again

gaunt shoal
#

:D

gleaming topaz
#

Actually no

#

I changed my mind I'm going full clang again

gaunt shoal
#

ohhhh fun

gleaming topaz
#

Gentoo is already fun, but why not make it even more fun!

gaunt shoal
#

:D

gleaming topaz
#

:D

#

For fun I enabled ~amd64 globally and then I saw how many packages it wanted to update :D

#

more than 100

gleaming topaz
#

Ay I did it I moved my gentoo make.conf to clang!

little merlin
gaunt shoal
# little merlin 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
little merlin
#

do you make your stage4 with catalyst?

gaunt shoal
#

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

gaunt shoal
#

I boostrap with portage

little merlin
#

ahh i see

gaunt shoal
#

then use mkstage4

little merlin
#

how's your experiene been with clang

gaunt shoal
#

Fairly good, it works well, I like it

#

Plan to stick with it

#

I use it on all my boxes

little merlin
#

currently in the middle of doing h/selinux but might switch to clang

gaunt shoal
#

(Router, Firewall, Server, Desktop, Laptop, TV Box, Raspberry Pi)

gaunt shoal
#

i made a custom profile for hardneed

little merlin
#

i tried llvm/systemd earlier but gcc and glibc kept failing to compile for some reason

gaunt shoal
#

ahhh there was a bug iirc

#

fixed now

#

also that reminds me

#

let me upload my dots

#

I got my server setup again

little merlin
#

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?

gaunt shoal
#

yep i had that issue

little merlin
#

i thought it was an lto issue but i didn't set up flto

#

how did you fix it

gaunt shoal
#

yea it was a gcc one iirc

#

it got fixed :)

#

it was just a bug

#

one day it just worked lmao

little merlin
#

it was literally just last night

gaunt shoal
#

oh

little merlin
#

that i tried doing it

gaunt shoal
#

in that case i would suggest filing a gentoo bug

#

as this happened like a month and a half ago for me

little merlin
#

ahh

#

hmm

#

maybe i'll try emerging world the first time without use flags first?

gleaming topaz
little merlin
#

i have a habit of using clang and llvm interchangeably haha

gleaming topaz
#

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

little merlin
#

yeah, i tried it twice, first time it was with -flto=thin

gaunt shoal
#

dots

little merlin
#

thought it was an lto error, so i tried again without it

#

no luck

little merlin
gaunt shoal
#

np

#

oh wait no you guys don't have access

gleaming topaz
#

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 simd

little merlin
#

i'll try using only those flags

gaunt shoal
little merlin
#

are you supposed to use -flto from the start or is that something you add once the system boots?

gaunt shoal
#

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
gleaming topaz
gaunt shoal
#

no why?

#

none of the stages are built with lto

gleaming topaz
#

wrong message

gaunt shoal
#

oh lmao

gleaming topaz
#

kernel with lto

little merlin
#

i'm going to destroy my zpool real quick brb

gaunt shoal
#

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

little merlin
#

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

gaunt shoal
#

Not sure I don't use it

#

I use dracut

#

Genkernel is basically dead iirc

little merlin
#

ahh i see

gleaming topaz
#

isn't genkernel used for gentoo-sources?

gaunt shoal
#

nononon gekernel is a seperate thing

little merlin
#

yep

#

wait what

gaunt shoal
#

for sys-kernel/gentoo-sources you can use no initramfs

#

or your own

little merlin
#

it does both kernel and initramfs

gaunt shoal
#

(but not with installkernel)

little merlin
#

you can --menuconfig all

gaunt shoal
#

@little merlin no thats genkernel

#

sys-kernel/genkernel pulls it in

#

but sys-kernel/gentoo-sources does not EXPLICTLY use tit

gleaming topaz
gaunt shoal
#

^

little merlin
#

hmm so would doing make menuconfig and dracut be better than genkernel

#

if i need to tweak the kernel

gaunt shoal
#

no

#

it wouldnt be

gaunt shoal
gleaming topaz
#

working fine

gaunt shoal
#

and use a custom kernel with it

#

i use a custom kernel with my dist kernel

#

to do it:

gleaming topaz
#

I'm using gentoo-kernel + custom name(thanks to Cow!)

gaunt shoal
#

first up apply the use flag 'savedconfig' to sys-kernel/gentoo-kernel

little merlin
gaunt shoal
#

then you simple do mkdir -pv /etc/portage/savedconfig/sys-kernel/

little merlin
#

i mean i'm doing clang rn but

gaunt shoal
little merlin
#

thinking of combining clang with hardened/selinux in the future

gaunt shoal
#

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

little merlin
#

oh so you can do menuconfig on the dist kernel?

gaunt shoal
#

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

little merlin
#

ahh i see

#

how do you menuconfig without the sources?

#

or do you grab that too

gaunt shoal
#

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

little merlin
#

but use the dist kernel

gaunt shoal
#

nononono

#

so you do

#

ebuild /var/db/repos/gentoo/sys-kernel/gentoo-sources/gentoo-sources-6.4.4.ebuild clean install

little merlin
#

ahh i see

gaunt shoal
#

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

little merlin
#

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

gleaming topaz
#

2 xeon's!

gaunt shoal
gaunt shoal
little merlin
#

hmm ok

#

i'll grab systemd llvm trarball then

gaunt shoal
#

thats my neofetch fyi

#

dont get the llvm tarball

little merlin
#

why?

gaunt shoal
#

it uses the experimental llvm profile iirc

#

those really should be manually set

little merlin
#

so do i do systemd normal and switch to llvm profile?

#

or

#

wait is the llvm profile not something i'm supposed to use

gaunt shoal
gleaming topaz
#

no you should stay on the normal profile

gaunt shoal
#

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

little merlin
#

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

little merlin
#

if i don't need to use llvm profile maybe i can pair this up with hardened/selinux?

little merlin
gaunt shoal
#

it doesnt really matter

gaunt shoal
#

also note you can use a custom profile

#

i create a custom one

#

for hardened

little merlin
#

so that it would work with llvm better?

#

how do you do that?

gaunt shoal
#

oh no i just did before one existed :P

#

you don't need to now

little merlin
#

oh so you basically just made your own version of the hardened profile?

gaunt shoal
#

yea

little merlin
#

that has nothing to do with clang/llvm?

gaunt shoal
#

yea basically

little merlin
#

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

gaunt shoal
#

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"

little merlin
#

is o3 safe?

#

ahh ok

gaunt shoal
#

yes

little merlin
#

thankss

gaunt shoal
#

i use it

#

np