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

Missing resp. Incomplete functions in Raspberry pi Pico port #957

Open
roman65536 opened this issue Jan 19, 2023 · 2 comments
Open

Missing resp. Incomplete functions in Raspberry pi Pico port #957

roman65536 opened this issue Jan 19, 2023 · 2 comments
Labels
bug Misbehaviour rather than feature request

Comments

@roman65536
Copy link

Tried to port Lua on Fuzix and looks like trigonometry Functions are incomplete :

arm-none-eabi-ld: ../../Library/libs/libmarmm0.a(sin.o): in function sin': /tmp/FUZIX2/FUZIX/Library/libs/sin.c:72: undefined reference to __sin'
arm-none-eabi-ld: /tmp/FUZIX2/FUZIX/Library/libs/sin.c:70: undefined reference to __rem_pio2' arm-none-eabi-ld: /tmp/FUZIX2/FUZIX/Library/libs/sin.c:73: undefined reference to __cos'
arm-none-eabi-ld: /tmp/FUZIX2/FUZIX/Library/libs/sin.c:74: undefined reference to __sin' arm-none-eabi-ld: /tmp/FUZIX2/FUZIX/Library/libs/sin.c:76: undefined reference to __cos'

longjmp/setjmp/mktime/strftime is also missing.

rgds
roman

@EtchedPixels EtchedPixels added the bug Misbehaviour rather than feature request label Jan 19, 2023
@EtchedPixels
Copy link
Owner

longjmp/setjmp are used by various base apps so definitely exist somewhere

strftime and mktime are not in the Fuzix libc. There is a mktime in Applications/util/setdate.c but it's GPLv2 not LGPL so can't go into the C library.

sin/cos is a bug in the library makefile I think. Some ports are not pulling in the helpers.

@roman65536
Copy link
Author

Found the longjmp/setjmp stuff, thanks for the hint.

sin/cos I think is more then just makefile. sin/cos has there helper functions __sin/__cos, they call __rem_pio2.
In __rem_pio2 is an macro called "STRICT_ASSIGN" and that one is missing:

/tmp/FUZIX2/FUZIX$ find . -name .[chsS] -exec fgrep -H STRICT_ASSIGN {} ;
./Library/libs/__rem_pio2.c: STRICT_ASSIGN(double, fn, x
invpio2 + 0x1.8p52);
./Library/libs/__rem_pio2_large.c: STRICT_ASSIGN(double,fw,fw);

but was able to get around by steeling from https://github.com/micropython/micropython/tree/master/lib/libm_dbl :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Misbehaviour rather than feature request
Projects
None yet
Development

No branches or pull requests

2 participants