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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build issue with macOS clang #71

Open
BSzili opened this issue Mar 29, 2019 · 1 comment
Open

Build issue with macOS clang #71

BSzili opened this issue Mar 29, 2019 · 1 comment

Comments

@BSzili
Copy link

BSzili commented Mar 29, 2019

I'm trying to build adtools on macOS Mojave, and this warning causes the compilation to fail:

/Users/bszili/Documents/adtools/binutils/repo/bfd/elflink.c:4975:45: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic]
return (struct elf_link_hash_entry *) 0 - 1;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/bszili/Documents/adtools/binutils/repo/bfd/elflink.c:5087:46: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic]
if (h == (struct elf_link_hash_entry *) 0 - 1)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
2 errors generated.

The compiler is: Apple LLVM version 10.0.0 (clang-1000.10.44.4)

@Midar
Copy link

Midar commented Apr 20, 2019

I ran into the same thing. What's missing here is --disable-werror in the configure flags for binutils. With this, building binutils on macOS works fine.

The reason for this is that Clang has much more warnings than GCC, and binutils by default turns them into errors.

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

No branches or pull requests

2 participants