10

I'm trying to build musl-libc on a machine running OS X 10.11.5. Unfortunately, I get the following error while running make:

clang: warning: optimization flag '-fexcess-precision=standard' is not supported
clang: warning: optimization flag '-frounding-math' is not supported
<inline asm>:6:1: error: unknown directive
.weak _DYNAMIC 
^
<inline asm>:7:1: error: unknown directive
.hidden _DYNAMIC 
^
2 errors generated.
make: *** [obj/crt/Scrt1.o] Error 1

I'm using Clang 7.3.0 (703-0-31) and I'm using the source pulled from the musl repo at git://git.musl-libc.org/musl.

Jules
  • 14,200
  • 13
  • 56
  • 101
  • Are you trying to use musl as a native OS X library? That will take more work than just getting it to compile. – Richard Pennington Oct 29 '16 at 14:02
  • Same problem with clang-1200.0.32.2 – Olsonist Oct 12 '20 at 15:50
  • @Olsonist check out user5555713's answer — musl relies on some directives which aren't supported in macOS, and others which _may_ be supported under a different name but possibly without identical behaviour. I never followed up on the musl mailing list but if you're pursuing this that'd be a good place to start with dev questions! – Jules Oct 13 '20 at 14:02

1 Answers1

4

These are OS X assembler errors and this means that it is different from a GNU as in the way it understands special weak and hidden symbol definitions in object files.

While .weak directive is possibly supported by Apple as as .weak_definition, .hidden is an ELF specific (OS X uses Mach-O binary file format).

  • I understand the original issue, but thanks for trying to find alternative instructions; I'm still wondering if there isn't an already-modified version of the library which would build on OS X. – Jules Oct 26 '16 at 14:01
  • 2
    Join and ask musl mailing list, last time I've heard of at least two forks for FreeBSD and Win32. There is also ongoing port to barebones hardware. –  Oct 28 '16 at 02:03