klange changed the topic of #osdev to: Operating System Development || Don't ask to ask---just ask! || For 3+ LoC, use a pastebin (for example https://gist.github.com/) || Stats + Old logs: http://osdev-logs.qzx.com New Logs: https://libera.irclog.whitequark.org/osdev || Visit https://wiki.osdev.org and https://forum.osdev.org || Books: https://wiki.osdev.org/Books
[_] has joined #osdev
[itchyjunk] has quit [Ping timeout: 272 seconds]
goliath has quit [Quit: SIGSEGV]
moon-child has joined #osdev
kof123 has joined #osdev
<mcrod`> at long last, the toolchain compiles
* mcrod` clap
<mcrod`> on CI*
<heat> linux kernal
heat has quit [Ping timeout: 258 seconds]
<moon-child> ayo can anyone from c++ explain wtf is going on here https://godbolt.org/z/q1qedo17n
<bslsk05> ​godbolt.org: Compiler Explorer
<moon-child> https://godbolt.org/z/E6cnszsz1 the equivalent rust output is straightforward and obvious
<bslsk05> ​godbolt.org: Compiler Explorer
<Mutabah> moon-child: Well, the first few `mov` instructions are the actual copy...
<Mutabah> the next parts might be allocator related?
<Mutabah> nope, from some looking at the headers (for GCC 8, as that's what I randomly have) that second field is the refcount
<Mutabah> aah... that's probably a bunch of stuff to do with destructing the other slot if it's not the same?
<moon-child> but why is it more code than rustc?
<Mutabah> Likely due to different semantics
<Mutabah> `x` and `y` could be the same instance
<moon-child> https://godbolt.org/z/od6f31a7q I don't think so, because this typechecks ok
<bslsk05> ​godbolt.org: Compiler Explorer
<moon-child> and I don't really see why it would matter, anyway, since you just have to incref before you decref (which the rust code does)
<Mutabah> Those are the same backing data, but not the same Arc
<Mutabah> `std::shared_ptr<int> a; f(a,a);` is what I meant
<moon-child> why does that matter?
<Mutabah> Race conditions writing into that memory I guess?
<moon-child> ?
<Mutabah> It's worth noting that I don't know for sure, just taking guesses based on what I could gleam from the rather dense C++ STL code
<Mutabah> But... say it's like I provided - there's only one reference active...
<Mutabah> you can't blindly free the destination first, becuase that would free the source too
<moon-child> yes, which is why--like I said--you incref the source first
<moon-child> which is what rust does
<moon-child> it has to be increfed first because you invoke the copy constructor to make a copy to pass into operator= (or something like that), no?
<Mutabah> hmm... I'm still not sure where ther TLS comes in here... unless it's some quirks of atomics
<Mutabah> Nope
<Mutabah> it uses `operator=(const Self& src)`
<moon-child> I see. Regardless, it can just incref the source first, so no problem
<Mutabah> looks like that's what it does... but with some checks and freeing
<moon-child> but why is there so much code?
<Mutabah> warning: incoming spam of around 10 lines (the implementation of the refcount copy)
<Mutabah> _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
<Mutabah> if (__tmp != _M_pi)
<Mutabah> {
<Mutabah> __tmp->_M_add_ref_copy();
<Mutabah> if (__tmp != 0)
<Mutabah> if (_M_pi != 0)
<Mutabah> _M_pi->_M_release();
<Mutabah> _M_pi = __tmp;
<Mutabah> }
<Mutabah> return *this;
<Mutabah> That's `/usr/include/c++/8/bits/shared_ptr_base.h` on my system
pretty_dumm_guy has quit [Quit: WeeChat 3.5]
<Mutabah> Oh my... I think the `pthread` references are it checking for multi-threading
<Mutabah> maybe to avoid the cost of an atomic, by using a relatively predictable branch
CaCode has joined #osdev
CaCode_ has joined #osdev
CaCode has quit [Ping timeout: 255 seconds]
dude12312414 has joined #osdev
dude12312414 has quit [Client Quit]
CaCode_ is now known as CaCode
netbsduser`` has joined #osdev
netbsduser`` has quit [Ping timeout: 258 seconds]
gog has quit [Ping timeout: 240 seconds]
netbsduser`` has joined #osdev
netbsduser`` has quit [Ping timeout: 258 seconds]
netbsduser`` has joined #osdev
vdamewood has joined #osdev
vdamewood has quit [Client Quit]
asarandi has joined #osdev
netbsduser`` has quit [Ping timeout: 260 seconds]
CaCode has quit [Quit: Leaving]
goliath has joined #osdev
Mutabah has quit [Remote host closed the connection]
danilogondolfo has joined #osdev
yoyofreeman has quit [Remote host closed the connection]
Left_Turn has joined #osdev
netbsduser`` has joined #osdev
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 264 seconds]
[_] has quit [Read error: Connection reset by peer]
netbsduser`` has quit [Ping timeout: 248 seconds]
gbowne1 has quit [Quit: Leaving]
torresjrjr has quit [Changing host]
torresjrjr has joined #osdev
Mutabah has joined #osdev
xenos1984 has joined #osdev
GeDaMo has joined #osdev
tixlegeek has joined #osdev
netbsduser`` has joined #osdev
gog has joined #osdev
xenos1984 has quit [Ping timeout: 245 seconds]
vai has joined #osdev
lojik has quit [Quit: ZNC 1.8.2 - https://znc.in]
lojik has joined #osdev
nyah has joined #osdev
vdamewood has joined #osdev
pretty_dumm_guy has joined #osdev
bauen1 has quit [Ping timeout: 255 seconds]
xenos1984 has joined #osdev
netbsduser`` has quit [Ping timeout: 260 seconds]
netbsduser`` has joined #osdev
Burgundy has joined #osdev
vai has quit [Ping timeout: 248 seconds]
craigo has joined #osdev
craigo has quit [Read error: Connection reset by peer]
craigo has joined #osdev
heat has joined #osdev
bauen1 has joined #osdev
sbalmos has joined #osdev
vdamewood has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<sham1> hi
tixlegeek has quit [Quit: tixlegeek]
<mcrod`> hi
<heat> no
<sham1> why not
<mcrod`> i should write a blog post about compiling LLVM
<mcrod`> LLVM wants zlib, CMake only exposes the dynamic libraries even if the static ones exist
<mcrod`> unless you use ZLIB_USE_STATIC_LIBS, which is only present in CMake >=3.24
<mcrod`> and that's not in any of the LTS repos for ubuntu
<zid> justcmakethings
<sham1> cmake. Not even once
<vaxuser> ninja is ok tho
<mcrod`> to make matters a little worse
<mcrod`> you don't find out if there's a problem until a long ways into the compilation
zxrom has quit [Quit: Leaving]
xenos1984 has quit [Ping timeout: 258 seconds]
goliath has quit [Quit: SIGSEGV]
tixlegeek has joined #osdev
<heat> mcrod`, you're not an LLVM expert, please don't
<mcrod`> you're rught
<mcrod`> right*
<mcrod`> you need to be a PhD at harvard to grasp it
<heat> i have a many-year-WIP pseudo-toolchain-porting-guide that I'll probably never release
<heat> the toolchain bits are easy to explain but the build system stuff? holy hell
<sham1> > harvard
<sham1> What is this, Harvard for a computer science thing?
<mcrod`> i was just making a jab at how complicated the build system is
<sham1> cmake is an annoying thing. I'm honestly starting to get more and more annoyed with "modern" build systems
<sham1> I might just embrace tradition and go full-on with either just makefiles or autotools for my personal projects
<heat> meson is nice
<sham1> meson is nice enough I suppose, yeah
<vaxuser> makefiles are utter crap
<sham1> They're everywhere, though
<sham1> And that has a quality of its own, even though I do agree that they're not all that good
<sham1> I do wish I could get away with [redo](https://cr.yp.to/redo.html), but alas
<bslsk05> ​cr.yp.to: Rebuilding target files when source files have changed
<heat> try ekam sham1
<mcrod`> i need a drink
<heat> vaxuser, i thought every BSD user loved bmake
<vaxuser> there are only 2 which don't hate it and both work on it
<vaxuser> also i thought you thought there are no bsd users
<heat> touché
<heat> of course you don't love bmake, you don't use the thing
<heat> waiiiiiiiiiiiiiiiiiiiiiiiiiit maybe BSD "users" "love" bmake because they've never used the thing
<mcrod`> ...
<mcrod`> so to get a fully static LLVM build, you can pass LLVM_BUILD_STATIC
<mcrod`> except for some reason, the build is being commanded to link a dynamic liblldb
<heat> are you stupid
<heat> static glibc??
<mcrod`> no
<mcrod`> "fully static" as in, its own dependencies are linked in statically, libpython is linked in statically, etc etc
<sham1> MUSL MUSL MUSL MUSL
<Celelibi> Makefiles <3 4ever
<vaxuser> indefinite moratorium on unix shit talk
<vaxuser> get in your jabs before it takes effect
<sham1> And who's gonna enforce the moratorium, you?
<heat> mcrod`, wrong
<mcrod`> wtf do you mean
<mcrod`> as far as I know it will statically link everything *but* glibc
<heat> if (LLVM_BUILD_STATIC)
<heat> set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
<heat> llvm/CMakeLists.txt
<mcrod`> i hate this planet.
<Celelibi> It's the only one we've got, sorry.
<mcrod`> so it's basically impossible to distribute a statically built LLVM within reason
<heat> if you don't set DYLIB and crap, all the libLLVM garbo is statically linked
<mcrod`> yeah that's all well and good
<mcrod`> but lldb wants liblldb.so
<heat> why are you building lldb
<heat> <heat> are you stupid
<mcrod`> what's wrong with building lldb?
<mcrod`> what kind of bullshit is that man, build a package and people have to ask why
<mcrod`> it doesn't matter *why*, it matters why *it doesn't work*
bauen1 has quit [Ping timeout: 248 seconds]
<mcrod`> ok I give up
tixlegeek has quit [Quit: tixlegeek]
bauen1 has joined #osdev
xenos1984 has joined #osdev
linearcannon has quit [Ping timeout: 255 seconds]
linear_cannon has joined #osdev
linear_cannon has quit [Remote host closed the connection]
linear_cannon has joined #osdev
<geist> yeah it's source you should be able to build it
<zid> that's a big ask for most projects
<zid> "This is hard to build, I'll add an even bigger build system" cycles
<Ermine> Godot uses scons apparently
<mcrod`> well currently
<mcrod`> I'm refactoring the project to just use the host compiler
<mcrod`> as far as the dependencies go, if you don't specify -USE_BUNDLED_WHATEVER_STATIC_HERE, it'll try and find_package() it, and if you don't have it, you're fucked, whereas if you do specify -USE_YADDA_YADDA, it'll grab and compile it using the host compiler
<mcrod`> and that seems to be the general way people do it
<zid> --with-static-libz
<zid> ftfy
<geist> yeah i know that our scripts we have at work to build it are basically pig lists of switches to pass it. like a page long
<geist> though i think that's a bit less becausethe build system needs it and more because the build is trying to be highly hermetic and link against precisely what is asked and nothing else, etc
gbowne1 has joined #osdev
<bslsk05> ​rsms/llvmbox - Self contained, fully static llvm tools & libs (3 forks/297 stargazers/Apache-2.0)
<mcrod`> huh
danilogondolfo has quit [Quit: Leaving]
<heat> geist, fwiw my patches and toolchain building are based on fuchsia :p
<heat> and my (local) rustc build too, basically lifted all of that logic from your infra
craigo has quit [Ping timeout: 272 seconds]
GeDaMo has quit [Quit: That's it, you people have stood in my way long enough! I'm going to clown college!]
<sortie> heat, how dare you those patches are highly optimized for shareholder value and you use them for your hobby
dude12312414 has joined #osdev
dude12312414 has quit [Remote host closed the connection]
valshaped7424880 has quit [Read error: Connection reset by peer]
<heat> i'm a dirty shareholder value leech
valshaped7424880 has joined #osdev
goliath has joined #osdev
Turn_Left has quit [Ping timeout: 255 seconds]
<mcrod`> hi
<moon-child> hi
zxrom has joined #osdev
<geist> heat: oh neat. yeah
<geist> it's complicated but the way they build things does sort of make sense if you want a highly hermetic build
_whitelogger has joined #osdev
Turn_Left has joined #osdev
sbalmos has quit [Ping timeout: 260 seconds]
sbalmos has joined #osdev
rwb is now known as rb
<heat> geist, tbf both LLVM and rust are horrid builds
<heat> rust is kinda palatable until you get into cross-compilation. like *wow* it's ass
rorx has quit [Ping timeout: 240 seconds]
<heat> also rust really insists in building its own LLVM
<heat> two shit builds in one basket
<moon-child> can you use cranelift?
<heat> as the rust backend? probably, but that adds extra horrendousness probably
<moon-child> but removes the llvm horrendousness
<heat> now not only is the target not supported, you're also building with barely supported backend stuff instead of the tried and true
<heat> at that point you say fuck it and go write zig or wahtever
<netbsduser``> these per-language package managers are a menace
<netbsduser``> no i don't want to download over 17 gigabytes and generate 697 gigabytes worth of wear to my SSD to build "hello world"
<heat> average nodejs project
<netbsduser``> the most compelling reason to use rust is to defy the community norms around this and don't use crates or CarGo
<heat> RUST RUST RUS TU STU TUSR TUSR TUST RUST RSTU CARGOOOOOOOOOOOOOOOOOOOOOOOo
<netbsduser``> escargot, my cargo, 160, swiftly
vai has joined #osdev
goliath has quit [Quit: SIGSEGV]
Burgundy has quit [Ping timeout: 260 seconds]
yoyofreeman has joined #osdev
yoyofreeman has quit [Max SendQ exceeded]
yoyofreeman has joined #osdev
rorx has joined #osdev
gabi-250_ has joined #osdev
gabi-250 has quit [Ping timeout: 256 seconds]
Turn_Left has quit [Read error: Connection reset by peer]
[itchyjunk] has joined #osdev
valshaped7424880 has quit [Quit: Gone]
valshaped7424880 has joined #osdev
<Ermine> heat: did your text get messed up due to MEMORY UNSAFETY?
<zid> Needs to buy soem ECC
valshaped7424880 has quit [Quit: Gone]
ThinkT510 has quit [Ping timeout: 252 seconds]
valshaped7424880 has joined #osdev
ThinkT510 has joined #osdev
Matt|home has joined #osdev
<zid> Did you all figure out what you're getting me for my brithday? It's in 23:36 so this is probably your last call to involve amazon in the transaction.
* moon-child wraps up a slightly used PRIVMSG--complete with a free ACTION!--and passes it on over to zid
<zid> you gave that to everybody though :(
<moon-child> no I usually give out new ones
<zid> yea but you didn't just give it to me, you gave it to everybody present, collectively
<zid> birthdays are supposed to be fascist not communist
<zid> Thank you, much better
pretty_dumm_guy has quit [Quit: WeeChat 3.5]
dude12312414 has joined #osdev