Page MenuHomeFreeBSD

Fix linker error in libuutil with recent LLVM
ClosedPublic

Authored by arichardson on Jul 14 2020, 10:29 AM.

Details

Summary

Not marking the function as static can result in a linker error:
undefined reference to __assfail [--no-allow-shlib-undefined]
I noticed this error after updating our CHERI LLVM to the latest upstream
LLVM HEAD revision.

This change effectively reverts r329984 and marks dmu_buf_init_user as static.

Test Plan

compiles again

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mav added a subscriber: mav.

dmu_buf_init_user() part is actually done in OpenZFS already.

__assfail() part looks OK to me too.

This revision is now accepted and ready to land.Aug 7 2020, 1:57 PM

r329984 was done for a reason. With your change, can you still build world with GCC6?

r329984 was done for a reason. With your change, can you still build world with GCC6?

This patch adds static to dmu_buf_init_user and should therefore fix the error.

Ok. As long as you've tested it with GCC6, then it's fine by me.

This revision was automatically updated to reflect the committed changes.