<g-w1>
just search up the scopes linked list until you find a defer
ikskuh has quit [Ping timeout: 250 seconds]
mq32 has joined #zig
<Raito_Bezarius>
when I'm trying to create an executable with target {.cpu_arch = .x86_64, .os_tag = .freestanding }, I'm getting an ELF with no .text, .data, how to debug this?
<Raito_Bezarius>
though there is a .o beside in the folder with a .text
<g-w1>
try build-obj
<g-w1>
i suspect that build-exe means nothing for freestanding as you are not exporting anything š¤
<g-w1>
also zig build --verbose might be useful
<Raito_Bezarius>
but empty ahem
<Raito_Bezarius>
indeed, it's calling build-exe
<Raito_Bezarius>
alright
<Raito_Bezarius>
exporting main as _start did the work
<g-w1>
š
<Raito_Bezarius>
is there a way to have a friendly main if I know how to write down the _start ?
<g-w1>
i would take a look at lib/std/start.zig
<g-w1>
it might have some insights waiting for you
<Raito_Bezarius>
seems like as long as the root file has a _start decl, it's good
<Raito_Bezarius>
but if I want to hide this in some library or OS specific stuff
<Raito_Bezarius>
is there a way to remotely set the decl for root files ?
<Raito_Bezarius>
ha
<Raito_Bezarius>
I understood
<Raito_Bezarius>
if I declare somewhere _start as an export
<Raito_Bezarius>
Zig will just declare there must be some _start somewhere and lld will pick it up
<Raito_Bezarius>
so as long as I import my OS stuff and it contains an export _start and is able to call main properly, it's a win I suppose
<g-w1>
yea
<Raito_Bezarius>
thanks g-w1 !
<g-w1>
you can do stuff like @export(@import("root").main, "_start") i think
<Raito_Bezarius>
awesome
<g-w1>
hmm, is there some way to either make breakpoints on something in another thread or make astgen single threaded (trying to break on a function in astgen, but i have a feeling that it is not happening in my thread)
<andrewrk>
astgen is effectively single threaded
<andrewrk>
I think you might be assuming something that isn't true because I don't understand your question
<g-w1>
(gdb) b AstGen.ret
<g-w1>
r (no breakpoints)
<g-w1>
well, nothing breaks
<andrewrk>
it sounds like it has to do with communicating breakpoints to gdb rather than anything to do with threads
<andrewrk>
try a line number instead
<g-w1>
ok
<andrewrk>
if you're working on astgen you probably want to be using the `zig astgen` command rather than the full frontend. that will simplify your development experience
<g-w1>
very weird, gna inversigate more
<g-w1>
oh, good idea š¤¦
casaca has quit [Ping timeout: 240 seconds]
mq32 has quit [Ping timeout: 245 seconds]
mq32 has joined #zig
<g-w1>
ah, the problem is not that trivial
<g-w1>
i see that anything after a defer block is also in a defer scope
casaca has joined #zig
hiljusti has quit [Ping timeout: 245 seconds]
tefter has joined #zig
zenkuro has joined #zig
zenkuro has quit [Ping timeout: 240 seconds]
zenkuro has joined #zig
arkurious has quit [Quit: Leaving]
hiljusti has joined #zig
zenkuro has quit [Ping timeout: 240 seconds]
zenkuro has joined #zig
ur5us__ has quit [Ping timeout: 250 seconds]
ur5us__ has joined #zig
hiljusti has quit [Ping timeout: 250 seconds]
detha has quit [Ping timeout: 276 seconds]
<andrewrk>
stage1 solution is fine, it has a "defer expression scope" that the expression is in, which is distinct from the scope that the defer creates for statements after it
<Nypsie>
Probably a std.io.fixedBufferStream or a std.fs.File
<Nypsie>
This is by simply grepping `seekableStream` and seeing what structures support that. The `read` function could probably use some doc comments to provide examples. (Note that own readers are supported as well, as long as they support the io.Reader interface and seekableStream)
sm2n has quit [Remote host closed the connection]
nathanael has quit [Remote host closed the connection]
sm2n has joined #zig
nathanael has joined #zig
r4pr0n has joined #zig
r4pr0n has quit [Client Quit]
sm2n has quit [Remote host closed the connection]
Kingreil has joined #zig
Stephie has left #zig ["Leaving"]
<tributarian>
Can I get a recommendation on a good zig codebase that I can read through to help me learn?
<op_4>
has the hubbab over libera.chat been discussed here?
<Thalheim>
oftc may be a better choice because by association if ex-freenode staff founded it, they may not be in the clear yet
<betawaffle>
wasn't oftc also founded by ex-freenode too, just longer ago?
<ifreund>
Thalheim: fair point, I'm now sqatting #zig there as well :D
<ifreund>
from what I've seen so far though, libera looks solid
<Thalheim>
betawaffle: less involved with the current drama
cr1901_modern has quit [Quit: Leaving.]
cr1901_modern has joined #zig
<op_4>
ifreund: great, thanks :)
earnestly has quit [Remote host closed the connection]
<daurnimator>
ifreund: I just joined libera now... so far I've lost connection twice and there is no services?
<yeti>
there is
<yeti>
but probably currently overrun by too many requests
nathanael has quit [Remote host closed the connection]
nathanael has joined #zig
<yeti>
currently lag >1200
<ifreund>
daurnimator: I think there servers just got overloaded, it was working fine 15 min ago
<cr1901_modern>
I can't even ping it right now
<ifreund>
anyhow I have #zig registered there
<yeti>
already in my autojoin list
<yeti>
;-)
nathanael has quit [Remote host closed the connection]
sord937 has quit [Remote host closed the connection]
Miaourt has quit [Quit: Bye!]
sord937 has joined #zig
mikdusan has joined #zig
Miaourt has joined #zig
leon-p has quit [Quit: leaving]
grive has quit [Quit: Bye]
grive has joined #zig
jmiven has quit [Quit: reboot]
grive has quit [Quit: Bye]
jmiven has joined #zig
v0idify has joined #zig
<v0idify>
hey, what's gonna happen with this channel?
<ifreund>
v0idify: nothing yet, I'm squatting #zig on libera and oftc until andrewrk wakes up
<v0idify>
ifreund: okie, thanks <3
<gpanders>
it's like a bank run over there, people grabbing channels and nicks like crazy
<Nilium>
Iām just sitting on my hands and waiting before I go join any channels and accidentally claim ops.
<Nilium>
Figuratively. Would be hard to type if I actually sat on them.
<plumm>
did you guys hear about the freenode walkout
<v0idify>
yes that's what we're talking about :P
<plumm>
sorry. ifreund are you able to register your nick there?
v0idify has left #zig ["WeeChat 2.3"]
<ifreund>
plumm: yes I was an hour or two ago, their email server is under very heavy load for registration though it seems
<plumm>
makes sense
semarie has quit [Quit: WeeChat 3.1]
powerofzero has joined #zig
<powerofzero>
Is structure packing implemented in the stage2 compiler? I'm looking to implement packing of unions in stage1, but I wanted to see if there was an implementation I could reference. I couldn't find and equivelent function to `pack_const_int` in stage2. Does it exist? If not, does a spec exist that I have to be sure to match, or can I just do it in a reasonable way?
<ifreund>
powerofzero: no, it is not yet implemented in stage2
<ifreund>
there is also not yet a formal spec
<powerofzero>
okay
grive has joined #zig
grive has quit [Quit: Bye]
powerofzero has quit [Ping timeout: 268 seconds]
hiljusti has joined #zig
grive has joined #zig
grive has quit [Client Quit]
grive has joined #zig
grive has quit [Quit: Bye]
grive has joined #zig
mikdusan has quit [Quit: WeeChat 3.0.1]
semarie has joined #zig
fwg has joined #zig
fwg has quit [Client Quit]
nathanael has joined #zig
nathanael has quit [Remote host closed the connection]
nathanael has joined #zig
hiljusti has quit [Ping timeout: 250 seconds]
nathanael has quit [Remote host closed the connection]
nathanael has joined #zig
nathanael has quit [Remote host closed the connection]
earnestly has joined #zig
patwid has left #zig ["WeeChat 3.1"]
mikdusan has joined #zig
semarie has quit [Quit: WeeChat 3.1]
semarie has joined #zig
grive has quit [Quit: Bye]
grive has joined #zig
eddyb[legacy] has quit [Quit: Updating details, brb]
Bernstein has quit [Remote host closed the connection]
sh4k4l has left #zig ["Leaving"]
zenkuro has quit [Ping timeout: 265 seconds]
bitmapper has quit [Quit: Connection closed for inactivity]
noeontheend has joined #zig
eddyb[legacy] has joined #zig
jokoon has joined #zig
[wtf] has joined #zig
r4pr0n has joined #zig
r4pr0n has quit [Client Quit]
notzmv has quit [Ping timeout: 246 seconds]
Kuraitou_ has quit [Quit: Leaving]
jokoon2 has joined #zig
hiljusti has joined #zig
jokoon has quit [Ping timeout: 258 seconds]
eddyb[legacy] has left #zig [#zig]
[wtf] has quit [Ping timeout: 260 seconds]
cole-h has joined #zig
CommunistWolf has left #zig ["The cause of labour is the hope of the world"]