Skip to content

[owc libc] Fix OWC link errors with small and compact models using _weaken#2238

Merged
ghaerr merged 1 commit intomasterfrom
weaken
Feb 24, 2025
Merged

[owc libc] Fix OWC link errors with small and compact models using _weaken#2238
ghaerr merged 1 commit intomasterfrom
weaken

Conversation

@ghaerr
Copy link
Copy Markdown
Owner

@ghaerr ghaerr commented Feb 24, 2025

Fixes #2237.

OWC wlink was failing to link vfprintf.obj in small and compact models due to the mechanism used to make "weak" symbols work using the _weaken macro, because the OWC compiler generates a far segment relocation entry which causes wlink to fail with a "relocation not in same segment" error.

This all happens because vfprintf attempts to be smart about dragging in the large dtostr and ptostr routines into printf when floating point/ptick display aren't used. One fix would be to always link in dtostr in small model OWC programs, which would make them considerably larger, so instead this fix eliminates automatically including dtostr/ptostr entirely, eliminating automatic floating point display using printf %f/%g or %k (ptick) format specifiers. Instead, the application will need to call dtostr or ptostr explicitly if needed.

Also removes /lib/nxworld.map from the image as Nano-X is now built outside of ELKS in the Microwindows repo, and it is installed from there when built.

@rafael2k
Copy link
Copy Markdown
Contributor

Thanks! Interesting topic about weak symbols and floating point support. Did not know about it.

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

Successfully merging this pull request may close these issues.

[OpenWatcom] Can not link with libc compiled in small memory model

2 participants