NetBSD Issue

44 views
Skip to first unread message

Brian Stuart

unread,
Dec 31, 2021, 2:22:52 PM12/31/21
to infer...@googlegroups.com
For various reasons, I'm switching my main UNIX from FreeBSD to
NetBSD. When I go to build mk using makemk.sh, I'm finding that the
compiler is getting upset about the fact that stdlib.h already has a
declaration for strtoll returning a long long int. That ends up
colliding with the declaration in lib9.h returning a vlong. What's
the best way to deal with this? From the various #ifs in stdlib.h, I
had expected that setting -std=c89 on the command line would make it
ignore the declarations in stdlib.h, but that doesn't seem to be the
case. I could try to fiddle the mkfiles to use the system versions of
strtoll and strtoull instead of the ones in lib9, but that seems
heavy-handed. Should I play the same game as we have for qsort and
define strtoll as infstrtoll, etc? Or is there a better way to deal
with it?

TIA
BLS

Valery Ushakov

unread,
Dec 31, 2021, 4:24:00 PM12/31/21
to inferno-os
Are you perhaps building on amd64 without -m32?  On 32-bit the lib9.h definition is compatible with the one in the system headers (b/c vlong is long long there).

Brian Stuart

unread,
Dec 31, 2021, 4:48:16 PM12/31/21
to Valery Ushakov, inferno-os
DOH! You are correct. I hadn't added the -m32 to
mkfiles/mkfile-NetBSD/386 when I was running into that issue. All is
much happier now (modulo the lack of 32-bit X libraries).

Thanks,
BLS
> --
> You received this message because you are subscribed to the Google Groups "inferno-os" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to inferno-os+...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/inferno-os/2d701a7b-18b8-458c-b54b-a189baf8d281n%40googlegroups.com.

Valery Ushakov

unread,
Dec 31, 2021, 4:55:32 PM12/31/21
to inferno-os
I don't remember, but I thought cc -m32 as linker should automatically pick up 32 bit libs from /usr/X11R7/lib/i386 given -L/usr/X11R7/lib  Since I use 32-bit NetBSD/i386 vms for this, it's been a while since I tested on amd64.

Valery Ushakov

unread,
Dec 31, 2021, 4:59:33 PM12/31/21
to inferno-os
Ah, stupid me.  I guess the ones I have I unpacked manually from the i386 sets (probably exactly for the purpose of testing inferno build)

Brian Stuart

unread,
Dec 31, 2021, 5:01:21 PM12/31/21
to Valery Ushakov, inferno-os
Gotcha. I might go that route as well, but probably not this evening.

Thanks,
BLS
> To view this discussion on the web, visit https://groups.google.com/d/msgid/inferno-os/f560dbe3-0d6a-4216-a3ad-96463a0399f8n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages