Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.40 build failure #2873

Open
Tracked by #20508
chenrui333 opened this issue Mar 29, 2024 · 4 comments 路 May be fixed by #3013
Open
Tracked by #20508

2.40 build failure #2873

chenrui333 opened this issue Mar 29, 2024 · 4 comments 路 May be fixed by #3013

Comments

@chenrui333
Copy link

馃憢 trying to build the latest release, but run into some build issue. The error log is as below:

error build log
  libuuid/src/uuid_time.c:89:87: error: aliases are not supported on darwin
  extern time_t uuid_time(const uuid_t uu, struct timeval *ret_tv) __attribute__((weak, alias("__uuid_time")));
                                                                                        ^
  1 error generated.

full build log, https://github.com/Homebrew/homebrew-core/actions/runs/8476769739/job/23226791433?pr=167458
relates to Homebrew/homebrew-core#167458

@jwillikers
Copy link
Contributor

I hit this issue for macOS as well using Meson.

@gershnik
Copy link

gershnik commented Apr 6, 2024

One way to fix this:

--- libuuid/src/uuid_time.c
+++ libuuid/src/uuid_time.c
@@ -85,6 +85,10 @@
 }
 #if defined(__USE_TIME_BITS64) && defined(__GLIBC__)
 extern time_t uuid_time64(const uuid_t uu, struct timeval *ret_tv) __attribute__((weak, alias("__uuid_time")));
+#elif defined(__clang__) && defined(__APPLE__)
+__asm__(".globl _uuid_time");
+__asm__(".set _uuid_time, ___uuid_time");
+extern time_t uuid_time(const uuid_t uu, struct timeval *ret_tv);
 #else
 extern time_t uuid_time(const uuid_t uu, struct timeval *ret_tv) __attribute__((weak, alias("__uuid_time")));
 #endif

@jwillikers
Copy link
Contributor

@gershnik Would you want to submit a PR?

@gershnik
Copy link

@jwillikers My fix fixes the surface issue - the build no longer breaks and uuid_time is aliased to __uuid_time on Darwin but I have only a hazy understanding of the intent behind the uuid_time changes in 2.40 to be able to say "this is how this should actually be fixed".

For example why usage of uuid_time64 is tied to __GLIBC__? Shouldn't something equivalent be also available for libc++ and Darwin?

Thus my comment was meant to unblock people who need the build not to break rather than to suggest a proper fix. (FWIW I maintain a CMake build of libuuid at https://github.com/gershnik/libuuid-cmake and the fix works there)

If the libuuid library authors agree that this is actually the proper fix, happy to submit a PR.

gershnik added a commit to gershnik/util-linux that referenced this issue May 6, 2024
Weak aliases are not supported by clang on Darwin.
Instead this fix uses inline asm to make `_uuid_time` and alias to `___uuid_time`

Fixes util-linux#2873
@gershnik gershnik linked a pull request May 6, 2024 that will close this issue
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 a pull request may close this issue.

3 participants