Conditionally add uuid_time64 to sym. version map#3037
Conditionally add uuid_time64 to sym. version map#3037karelzak merged 1 commit intoutil-linux:masterfrom
Conversation
|
As mentioned in bug #3036, an alternate approach is to add Please let me know which method this project prefer. |
|
We need @thkukuk here :-) The changes in the libuuid/src/Makemodule.am seems like overkill. you can specify the version-script more than once, so we can split the file to libuuid.sym and libuuid64.sym and do something like: rather than generate the symbols file :-) |
|
Maintaining two nearly identical symbol version maps will not work, people will forget quickly to adjust both files. |
|
Maybe instead of playing around with two symbol version files, we could use: |
|
Using two symbol files does not work if they specify the same version tags. |
|
It's interesting, but it works to split the version script into more files and I have tried: and and but libuuid.sym is only UUID_1.0, and libuuid-foo.sym is the rest. I guess it was designed for situations when you need to maintain each version on a separate file. It does not mean we need to use it; just want to share what I learned today :-)) The situation is so special that I think using |
|
The | but libuuid.sym is only UUID_1.0, and libuuid-foo.sym is the rest. |
|
What about using a glob in the version file: |
What does it mean? There is only uuid_time64 in 2_40. We can skip this version in the map file. Or does the file force the linker to completely ignore asm directives? Would it be possible to have always defined uuid_time64()? |
Looks like the local rule in the map file overwrites the asm directive. But I haven't looked yet deeper at it, if not possible or a bug in my tests.
That should be possible. I will try to look at this on Wednesday earliest. |
|
I'm a bit late, but the asm symver thing is usually a problem as it breaks with LTO. |
|
Also note: #3013 |
|
About always adding uuid_time64(): what about pure 32bit architectures, which have no time64_t? We could add a dummy uuid_time64 here, too, but since there is no error handling, I don't like that idea. Could lead other developers to do stupid ideas. About multiple version scripts: all documentation is always speaking about one version script, I couldn't find anything about specifying multiple one. I'm waiting now for feedback from some ld developers. |
|
For me the glob It would prevent us from adding new symbols with the prefix |
|
I didn't try glob uuid_time64*, but if it works, we can use it. It seems like a pretty minimalistic change. It's strange that there is not any "good practice" to do such a thing. It seems like we reinventing the wheel :-) |
As this was not an error until now from ld, I'm afraid the big wave with bug reports is now only coming. It's only the second report I saw now, but I'm aware of many more projects with functions which are not always available. |
uuid_time64* does work. I'll update the PR to make only that change. |
The symbol uuid_time64 is conditionally defined. It only exists on
32-bit platforms that use the glibc library and enable support for
the 64-bit time_t type.
For all other platforms, the symbol is undefined. As a result, when
ld.lld version 17 or newer is used with default flags, ld.lld will
reject the symbol map with the error:
version script assignment of 'UUID_2.40' to symbol 'uuid_time64'
failed: symbol not defined
To fix this issue, the reference to uuid_time64 is changed to
uuid_time64*. The change to a glob pattern satisifies ld.lld and allows
the library to link.
fixes util-linux#3036
fixes Gentoo bug #931328
Signed-off-by: Nicholas Vinson <[email protected]>
|
If there are no other changes requested, could this PR be merged? Thanks. |
The symbol uuid_time64 is conditionally defined. It only exists on 32-bit platforms that use the glibc library and enable support for the 64-bit time_t type.
For all other platforms, the symbol is undefined. As a result, when ld.lld version 17 or newer is used with default flags, ld.lld will reject the symbol map with the error:
To fix this issue, configure.ac and libuuid/src/Makemodule.am are updated to determine which version of the symbol map is needed, and supply the proper symbol map to ld.lld when linking.
fixes #3036
fixes Gentoo bug #931328