Skip to content

Fix undefined references - #50

Merged
aswaterman merged 1 commit into
ucb-bar:masterfrom
nadime15:fix-undefined-reference
Oct 27, 2026
Merged

aswaterman merged 1 commit into
ucb-bar:masterfrom
nadime15:fix-undefined-reference

Conversation

@nadime15

Copy link
Copy Markdown
Contributor

Building without optimizations can fail to link with undefined references to some inline functions, for example softfloat_countLeadingZeros32. If I understand correctly, a plain inline function might never get emitted in C99, so there is nothing to link against. Using static inline fixes this.

Issue was also discussed in #11.

Building without optimizations can fail to link with undefined
references to some inline functions, for example softfloat_countLeadingZeros32.
If I understand correctly, a plain inline function might never get
emitted in C99, so there is nothing to link against. Using static
inline fixes this.

Issue was also discussed in ucb-bar#11.

Signed-off-by: Nadime Barhoumi <nadime@riscv.org>
@nadime15

Copy link
Copy Markdown
Contributor Author

The Sail RISC-V community came across this issue a while ago and fixed it by using static inline, see:

riscv/sail-riscv#1176

@aswaterman

Copy link
Copy Markdown
Member

It would be better to handle these the same way as the other routines like softfloat_shortShiftRightJam64 and actually provide the linkable version, rather than changing the definition of INLINE. I'll handle it.

@aswaterman aswaterman closed this Oct 27, 2026
@aswaterman

Copy link
Copy Markdown
Member

Hmm, actually I'm coming around to your conclusion.

@aswaterman aswaterman reopened this Oct 27, 2026
@aswaterman
aswaterman merged commit 3b1dc06 into ucb-bar:master Oct 27, 2026
1 check passed
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.

2 participants