ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
quc has quit [Read error: Connection reset by peer]
<andrewrk>
t5c, I did some research. I know how to implement __guard_local
<andrewrk>
it's actually an extern variable that needs to be in the ".openbsd.randomdata" section
<andrewrk>
and that's it
<andrewrk>
extern var __guard_local: c_long section(".openbsd.randomdata");
<andrewrk>
comptime { if (builtin.os == builtin.Os.openbsd) @export("__guard_local", __guard_local, builtin.GlobalLinkage.Strong);
<andrewrk>
put that in std/special/builtin.zig and do a build-exe. this will generate foo.o builtin.o compiler_rt.o
<andrewrk>
link those together and you should have no missing symbols
<GitHub53>
zig/master a630d3e Andrew Kelley: zig fmt: fix rendering of align keyword of slice type
davr0s has joined #zig
<Hejsil>
andrewrk, we probably want a lot of these parser fixes on the zig-fmt-pointer-reform branch too :)
<Hejsil>
Because that branch cant parse the randomizer
<andrewrk>
Hejsil, good point. the actual commit that changes prefix -> postfix is small, I might just branch off master and make that commit against it
<Hejsil>
Seeing my git diff explode is horrifying
<Hejsil>
Though most format changes do look alot better than my original format
<andrewrk>
I'm going to bed. Talk to you later
<donpdonp>
c.pthread_create(&thread, null, net_go => error: expected type '?extern fn(?&c_void) ?&c_void', found 'fn(?&c_void) ?&c_void'
<donpdonp>
so I want to define net_go myself in the zig code. how do I satisfy the pthread_create param?
<donpdonp>
(the only diff in the signatures is extern)
<donpdonp>
extern fn net_go(url_cstr: ?&c_void) ?&c_void does work, but im not really sure if thats correct to do.
<donpdonp>
in other news, how do I get that c_void ptr back into a string?
<donpdonp>
var url = @ptrCast(&[]const u8, url_cstr); => error: cast increases pointer alignment / '?&c_void' has alignment 1 / '&[]const u8' has alignment 8
<donpdonp>
which is some nice error detail but i never had to think about c string alignment before.
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<donpdonp>
apparently i was trying too hard. var url = @ptrCast(&u8, url_cstr); works.
<donpdonp>
its a point to a single u8, but hey go head and read any number of u8's after that one :)
davr0s has joined #zig
<Hejsil>
I think defining net_go as extern is correct
<Hejsil>
That ensures C calling convention, which is what pthread probably wants :)
<donpdonp>
saw that .o fly by during make. 8086 float emulation or some such? zounds.
<t5c>
andrewrk: compiling the echo world example works. running it give a segfault. I did horrible things to link.cpp but it does compile now...
<t5c>
can't really debug the binary because OpenBSDs gdb is too old it seems
<t5c>
*sigh* why is it never easy with this OS.
<t5c>
ok, debugging works. segfaulting at _thread_finalize();
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
JinShil has quit [Quit: Leaving]
quc has joined #zig
<t5c>
andrewrk: https://pastebin.com/2Sbru00u that is the WIP right now. I commented everything out in analyze.cpp just to get it linking. it now produces binaries that segfault on every libc call
<t5c>
analyze.cpp and link.cpp
cmc has quit [Ping timeout: 260 seconds]
davr0s has joined #zig
bheads has quit [Quit: Konversation terminated!]
bheads has joined #zig
bheads has quit [Quit: Konversation terminated!]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
return0e has quit [Remote host closed the connection]
davr0s has joined #zig
Hejsil has quit [Quit: Page closed]
return0e has joined #zig
return0e has quit [Read error: No route to host]
Hejsil has joined #zig
return0e has joined #zig
<andrewrk>
t5c, can I see your output for --verbose-link ?
darithorn has joined #zig
<andrewrk>
t5c, looks like you commented out some of the libc start objects. that's probably the cause of the segfault
<andrewrk>
libc depends on a bunch of .o files
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Hejsil has quit [Quit: Page closed]
davr0s has joined #zig
Hejsil has joined #zig
<Hejsil>
Now that we have @typeInfo, I would assume that a lot of builtins goes away, correct?