Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need -lgcc for tttt build #3

Open
DanielO opened this issue Sep 18, 2019 · 3 comments
Open

Need -lgcc for tttt build #3

DanielO opened this issue Sep 18, 2019 · 3 comments

Comments

@DanielO
Copy link

DanielO commented Sep 18, 2019

Hi,
I am following http://zipcpu.com/zipcpu/2018/02/12/zbasic-intro.html and I got this trying to build tttt:

[ubuntu 13:45] /media/psf/Home/projects/zbasic/sw/board >make tttt
CROSS=zip- ARCH=zip make --no-print-directory -C tttt/src ARCH=zip CROSS=zip- zip-tttt
Building dependency file
zip-gcc -T../../../zlib/../board/board.ld obj-zip/comborow.o obj-zip/comboset.o obj-zip/gboard.o obj-zip/strategy.o obj-zip/vset.o obj-zip/main.o -L../../../zlib -Wl,--start-group -Wl,--Map=zip-tttt.map -lzbasic -lc -lg -o zip-tttt
/media/psf/Home/projects/zipcpu/sw/install/cross-tools/lib/gcc/zip/6.2.0/../../../../zip/lib/libc.a(lib_a-vfprintf.o): In function `_vfprintf_r':
vfprintf.c:(.text+0x648): undefined reference to `__unorddf2'
vfprintf.c:(.text+0x664): undefined reference to `__ledf2'
vfprintf.c:(.text+0x7f8): undefined reference to `__eqdf2'
vfprintf.c:(.text+0x1470): undefined reference to `__eqdf2'
vfprintf.c:(.text+0x1b1c): undefined reference to `__nedf2'
vfprintf.c:(.text+0x1f28): undefined reference to `__unorddf2'
vfprintf.c:(.text+0x1f48): undefined reference to `__ltdf2'
vfprintf.c:(.text+0x2004): undefined reference to `__nedf2'
/media/psf/Home/projects/zipcpu/sw/install/cross-tools/lib/gcc/zip/6.2.0/../../../../zip/lib/libc.a(lib_a-dtoa.o): In function `_dtoa_r':
dtoa.c:(.text+0x2c4): undefined reference to `__eqdf2'
dtoa.c:(.text+0x3a0): undefined reference to `__floatunsidf'
dtoa.c:(.text+0x3c0): undefined reference to `__subdf3'
dtoa.c:(.text+0x3d8): undefined reference to `__muldf3'
dtoa.c:(.text+0x3f0): undefined reference to `__adddf3'
dtoa.c:(.text+0x400): undefined reference to `__floatsidf'
<snip>

I found it necessary to add -lgcc to the XLIBS line.

@ZipCPU
Copy link
Owner

ZipCPU commented Sep 19, 2019

Good catch!

I didn't initially use -lgcc, but became needed once I was able to build it because it provided soft-floating point.

I should probably place -lgcc into the default command line for the tools to fix this. For now, I expect to just change the zbasic instructions.

Dan

@DanielO
Copy link
Author

DanielO commented Sep 19, 2019

OK, I wasn't sure where to file it since your blog doesn't have a bug tracker ;)

WRT needing it - I think it does depend on your compiler version but it's mostly black magic to me..

@ZipCPU
Copy link
Owner

ZipCPU commented Oct 19, 2019

Yeah, "mostly black magic".

I'm still looking for the "right way" to handle this fix. Part of the difficulty is that -lgcc depends upon the C library, but you shouldn't need to specify "-lc -lgcc" on the command line (which I just had to do for a project), so this is definitely an issue and I'm looking into it. At least for now there's a work around, but it's not really the solution I want. I'm going to leave this open until I figure it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants