Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#14963 closed bug (fixed)

[Build System] error: 'strcmp' was not declared in this scope (on macos)

Reported by: diver Owned by: bonefish
Priority: normal Milestone: R1/beta2
Component: Build System Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description (last modified by diver)

macOS Mojave 10.14.6

  • create an image with DiskUtil and format it with Mac OS Extended (Case-sensitive, Journaled)
    brew install autoconf xorriso gawk git wget nasm less mpfr gmp libmpc bison mtools
    brew link bison --force
    git clone --depth=1 https://review.haiku-os.org/buildtools
    git clone https://review.haiku-os.org/haiku
    cd haiku
    mkdir generated.x86_64; cd generated.x86_64
    ../configure --build-cross-tools x86_64 ../../buildtools
    jam -q -j2 @nightly-anyboot
    

https://discuss.haiku-os.org/t/build-haiku-on-mac-failed/7876/13

Change History (13)

comment:1 by waddlesplash, 5 years ago

IIRC when I investigated this with jscipione, a syscall trace showed that GCC was not even looking for String.h, and instead was just including string.h, as if the filesystem was case-insensitive. I didn't find any reason for why it would do that, and asking the GCC developers, they said that their builds handled this case just fine (they did not test with our cross tools though.) So I am rather stumped.

comment:2 by jscipione, 5 years ago

I don't think that case-sensitivity is the issue here because I tried replacing every instance of #include <string.h> with #include <cstring> and it still ends up erroring out looking for missing symbols from string.h.

comment:3 by waddlesplash, 5 years ago

Guess what <cstring> does?

#include <string.h>

So, that proves nothing.

comment:4 by waddlesplash, 4 years ago

I've run into this on Windows with case-sensitive NTFS with MSYS2, following hrev54127. I've confirmed that the two different String.h cannot be opened with different cases, but nonetheless, the error occurs.

comment:6 by waddlesplash, 4 years ago

I added

#define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 0

to the top of that file (as the lower defines are in #ifndef) and it did not help.

comment:7 by waddlesplash, 4 years ago

Ah, there are actually two copies of that file: one in binutils and one in gcc. Maybe both need to be modified.

comment:8 by waddlesplash, 4 years ago

Nope, that produced no difference, either. However, it looks like I have a system libiberty installed, which may be the source of this problem. I'll try removing it and see if that helps.

comment:9 by waddlesplash, 4 years ago

Resolution: fixed
Status: newclosed

Fixed in btrev43156.

comment:10 by diver, 4 years ago

Description: modified (diff)
../src/system/libnetwork/netresolv/irs/nslexer.l:44:10: fatal error: nsparser.h: No such file or directory

fixed by brew link bison --force

Successfully built haiku-nightly-anyboot.iso on macOS.

comment:11 by pulkomandy, 4 years ago

Can we add that to the build instructions at https://www.haiku-os.org/guides/building/pre-reqs

And I guess make macOS a supported OS again?

Version 0, edited 4 years ago by pulkomandy (next)

in reply to:  10 comment:12 by return_0e, 4 years ago

Replying to diver:

../src/system/libnetwork/netresolv/irs/nslexer.l:44:10: fatal error: nsparser.h: No such file or directory

fixed by brew link bison --force

Successfully built haiku-nightly-anyboot.iso on macOS.

Does this build on the latest macOS i.e. Catalina (10.15.4) Most likely people will try the latest Xcode to attempt building Haiku which is 11.4.1 (11E503a).

Replying to pulkomandy:

And I guess make macOS a supported OS again there?

That depends on the version of macOS and Xcode. I'm not sure if this fixes building on High Sierra and later, but ideally we should support building on the latest stable versions of both macOS and Xcode. I'm trying out a build on Catalina and the latest Xcode myself. I'll report here if it builds or not.

comment:13 by nielx, 4 years ago

Milestone: UnscheduledR1/beta2

Assign tickets with status=closed and resolution=fixed within the R1/beta2 development window to the R1/beta2 Milestone

Note: See TracTickets for help on using tickets.