-
Notifications
You must be signed in to change notification settings - Fork 177
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
fix build with llvm16+ where --no-undefined-version is the default #1200
base: master
Are you sure you want to change the base?
Conversation
a4afc1a
to
bca629e
Compare
Hey, this is very neat! I need to spend some time reviewing this, but yeah, the idea is sound, and we're almost certainly going to need to be doing this in the longer term as the linker-editors become more strict. |
Sounds good, I do have some bandwidth to push this PR to submission so let me know whenever you get the time. |
rk_freehostent; | ||
rk_freeifaddrs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be `#ifdef``'ed somehow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at
heimdal/lib/roken/getifaddrs.c
Line 56 in cb9a130
#ifdef HAVE_IFADDRS_H |
#ifdef
or #ifndef
? I think I can use that ifdef right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great question. I'm not sure, but I think you're right. @jaltman may know.
rk_localtime_r; | ||
rk_memmem; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do use memmem()
/rk_memmem()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I deleted this because memmem
is redirected to rk_smemmem
. Take a look at
Line 505 in cb9a130
#ifndef HAVE_MEMMEM |
Is this intentional? I don't find any other references to rk_memmem
directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it gets renamed to rk_memmem()
, so the three uses in kdc/connect.c
are actually uses of rk_memmem()
(but only when the OS/C library doesn't have a memmem()
). That's intentional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the annoyance and my possible misunderstanding of your comment, but could you point me to the definition of rk_memmem
? Here's my understanding:
-
Renaming of
memmmem
tork_smemmem
happens here:Lines 506 to 507 in cb9a130
#define memmem rk_smemmem ROKEN_LIB_FUNCTION void * ROKEN_LIB_CALL memmem(const void *, size_t, const void *, size_t); -
Definition of
memmem
(which gets renamed again tork_smemmem
by the previous macro) is here:Lines 38 to 41 in cb9a130
#ifndef HAVE_MEMMEM #include "roken.h" ROKEN_LIB_FUNCTION void * ROKEN_LIB_CALL memmem(const void *haystack, -
All calls of
memmem
happen inkdc/connect.c
Where does the renaming happen for memmem
to rk_memmem
? Note the difference of the letter s
between rk_memmem
and rk_smemmem
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Argh, where did that s
come from? Well, that's clearly a typo. Now I'm curious how this works on Windows.
@@ -219,8 +301,6 @@ HEIMDAL_ROKEN_2.0 { | |||
rtbl_set_flags; | |||
rtbl_set_prefix; | |||
rtbl_set_separator; | |||
signal; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we even need the signal()
wrapper? And why isn't it called rk_signal()
? @jaltman. Maybe we should just remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll keep it removed for now then
I think this is pretty close. Thanks for doing this work! |
Can you give repro instructions for those errors? They look unrelated to my changes. Things are building successfully on my local system with LLVM 17. Quick thing I noticed, I've accidentally added libedit's |
@svmhdvn you can see those in the Windows build errors in the checks that are being run on this PR. Just click on |
How can I trigger the Windows build again? My PR doesn't seem to trigger it anymore. |
See
|
If the latest version of my PR doesn't trigger any windows builds due to the windows filter, then it shouldn't affect the windows build in any way right? Is this review otherwise complete? |
I'll do a final review and merge. Thanks! |
LLVM 16+ enables the
--no-undefined-version
flag in LLD by default in commit llvm/llvm-project@241dbd3. This causes many build errors of the form:error: version script assignment of <VERSION> to symbol <SYMBOL> failed: symbol not defined
in heimdal.This patch enables preprocessing of the
version-script.map
files so that we can conditionally export symbols in version scripts based on#define
values inconfig.h
.