<g-w1>
%= iterates a number so that you can have the same thing multiple times; it also works in zig
<g-w1>
eg: 000087a8 <__delay_0>:
<g-w1>
i am trying to do this tutorial: https://wiki.osdev.org/ARM_RaspberryPi_Tutorial_C in zig with the raspberry pi 0. it tells me to run this arm-none-eabi-gcc -mcpu=arm1176jzf-s -fpic -ffreestanding -c boot.S -o boot.o, but when I do -mcpu=arm1176jzf-s in zig build-obj i get error: Unknown CPU: 'arm1176jzf' (i already asked on embedded zig discord server, want to know if anyone here has some more thoughts)
<ifreund>
and nope I fell alseep before actually getting anything done last night :D
aerona has quit [Quit: Leaving]
waffle_ethics has quit [Read error: Connection reset by peer]
waffle_ethics has joined #zig
cole-h has quit [Ping timeout: 268 seconds]
andreao5 has joined #zig
andreao has quit [Ping timeout: 240 seconds]
andreao5 is now known as andreao
yyp has quit [Ping timeout: 240 seconds]
yyp has joined #zig
daex_ has joined #zig
daex has quit [Ping timeout: 268 seconds]
yyp has quit [Quit: now it's safe to turn off your computer]
waleee-cl has joined #zig
daex_ is now known as daex
artmb has joined #zig
artmb has quit [Ping timeout: 240 seconds]
artmb has joined #zig
artem1 has joined #zig
artmb has quit [Ping timeout: 265 seconds]
artem1 has quit [Ping timeout: 260 seconds]
artem1 has joined #zig
wilsonk__ has quit [Quit: Leaving]
dyeplexer has joined #zig
artem1 has quit [Ping timeout: 246 seconds]
artem1 has joined #zig
wilsonk has joined #zig
leon-p has joined #zig
notzmv has quit [Ping timeout: 260 seconds]
artem1 has quit [Ping timeout: 260 seconds]
artem1 has joined #zig
gpanders has joined #zig
jokoon has joined #zig
nycex has quit [Ping timeout: 240 seconds]
jokoon has quit [Quit: Leaving]
nycex has joined #zig
qbit has quit [Quit: leaving]
qbit has joined #zig
meatcar has quit [Ping timeout: 252 seconds]
meatcar has joined #zig
jcmdln has joined #zig
notzmv has joined #zig
nycex- has joined #zig
nycex has quit [Ping timeout: 240 seconds]
andreao2 has joined #zig
andreao has quit [Ping timeout: 240 seconds]
andreao2 is now known as andreao
artem1 has quit [Ping timeout: 250 seconds]
artem1 has joined #zig
TheLemonMan has joined #zig
artem1 has quit [Ping timeout: 250 seconds]
bitmapper has joined #zig
Snetry has quit [Ping timeout: 240 seconds]
sord937 has quit [Quit: sord937]
Snetry has joined #zig
cole-h has joined #zig
artem1 has joined #zig
artem1 has quit [Ping timeout: 250 seconds]
artem1 has joined #zig
donaldallen has joined #zig
<donaldallen>
The zig language reference talks about 'extern' for calling foreign functions. In the examples, the syntax 'extern fn' and things like 'extern "c" fn' appear, but nowhere is the literal following 'extern' documented. Would someone please explain to me what the purpose of that literal is? It doesn't seem to matter in code whether I include it or not
<donaldallen>
(the C libraries I need are specified to zig and so the externs get resolved at link time with or without the literal).
<ifreund>
donaldallen: that string indicates the name of the library the extern function is provided by
<ifreund>
if you leave it out, zig looks for the symbol in all libraries you link against
<donaldallen>
Thinking the literal was the ABI, I externed some functions that were in the gtk and sqlite libraries as 'extern "c"' and there were no linking errors and the code worked. My point is that those functions weren't in libc, but they were found nonetheless. Perhaps using the literal causes linking to try the referenced library first, but if not found,
<donaldallen>
search the rest? In any case, it sounds like this is simply for optimizing linking time but otherwise unnecessary?
<TheLemonMan>
the part between quotes is sort-of useless if you're not targeting Windows, it only serves for the compiler to automagically add a "-l<string>" entry in the linker invocation
Akuli has joined #zig
<donaldallen>
Your "sort-of-useless" comment is in line with my experience on Linux and FreeBSD. This really needs to be documented, though I'm aware that there is at least one issue outstanding related to this. Perhaps the documentation is waiting on a re-thinking of this?
<donaldallen>
Thanks for the help.
donaldallen has quit [Quit: Connection closed]
artem1 has quit [Ping timeout: 258 seconds]
artem1 has joined #zig
artem1 has quit [Ping timeout: 246 seconds]
andreao has quit [Ping timeout: 240 seconds]
dyeplexer has quit [Remote host closed the connection]
yyp has joined #zig
artem1 has joined #zig
donaldallen has joined #zig
donaldallen has quit [Client Quit]
artem1 has quit [Ping timeout: 246 seconds]
artem1 has joined #zig
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
artem1 has quit [Ping timeout: 258 seconds]
artem1 has joined #zig
artem1 has quit [Ping timeout: 250 seconds]
artem1 has joined #zig
artem1 has quit [Ping timeout: 246 seconds]
<mikdusan>
sigh - new in cmake 3.20 is another policy warning that causes those who build LLVM (12.x, haven't tried other versions), to emit >= 1000 lines of some new warning
plumm has joined #zig
artem1 has joined #zig
artem1 has quit [Ping timeout: 246 seconds]
nvmd has joined #zig
jjido has joined #zig
artem1 has joined #zig
cole-h has quit [Quit: Goodbye]
cole-h has joined #zig
sundbp has quit [Ping timeout: 260 seconds]
yyp has quit [Quit: now it's safe to turn off your computer]
yyp has joined #zig
earnestly has quit [Ping timeout: 265 seconds]
SimonNa has joined #zig
<g8U4Z1xGzjlm>
a c library returns a char** array, how do i convert those to zig types? warn("w: {}\n", .{@ptrCast([*]u8, chararray[i])}); only outputs u8@7ff4cb9ecca0
<ifreund>
are you expecting the inner char * to be a null terminated string?
<ifreund>
how you convert char** to zig types depends on the semantics of the C code
<g8U4Z1xGzjlm>
ah. i gotit. @ptrCast([*:0]u8, chararray[i]) was the magic.
earnestly has joined #zig
GreaseMonkey has joined #zig
Akuli has quit [Quit: Leaving]
ur5us has joined #zig
<ifreund>
g8U4Z1xGzjlm: you don't need to @ptrCast() there, @as() will suffice
<ifreund>
assuming that chararray is a [*c][*c]u8
<g8U4Z1xGzjlm>
yeah
<g8U4Z1xGzjlm>
thanks!
yyp has quit [Quit: now it's safe to turn off your computer]