Porting issues R1B4 vs nightly

The way I understand the constants:

  • _DEFAULT_SOURCE is “what’s enabled by default” (unless you ask for a strict C standard). In our case this enables both GNU and BSD extensions
  • _GNU_SOURCE is “enable GNU extensions”
  • _BSD_SOURCE is “enable BSD extensions”

But… GNU does not do that. They removed _GNU_SOURCE and they have only _DEFAULT_SOURCE now, so it’s not possible to ask for GNU extensions and not BSD ones. Which means GNU extensions includes BSD extensions, and the distinction between _GNU_SOURCE and _DEFAULT_SOURCE is nonexistant now.

So, we can do like them, have only _DEFAULT_SOURCE and _BSD_SOURCE (for people who want only the BSD extensions but not the GNU ones), I guess? But there’s an argument for _DEFAULT_SOURCE also including some Haiku-specific things? Do we want to do that? Or will we make all Haiku specific things be in separate headers with different names?

Right now features.h doesn’t define _GNU_SOURCE automatically. So I think either it should, or instead the headers that look for it should use _DEFAULT_SOURCE, right?

Then again, GNU extensions aren’t used as commonly, so maybe things should stay more as they are.

Yes, in the current situation it should all use _DEFAULT_SOURCE and not _GNU_SOURCE (following what is done in glibc).

Maybe not a real issue beta vs nightly, but 32bit buildmaster still seems to pull in old rust version that is linked to a non existing old openssl version.

1 Like

Guess I hit another one checking and failing to find: -- Looking for _GNU_SOURCE - not found
In the CMakeLists.txt is:

# check if _GNU_SOURCE is available

if (NOT _GNU_SOURCE)
    check_symbol_exists(__GNU_LIBRARY__ "features.h" _GNU_SOURCE)

    if (NOT _GNU_SOURCE)
        unset(_GNU_SOURCE CACHE)
        check_symbol_exists(_GNU_SOURCE "features.h" _GNU_SOURCE)
    endif ()
endif ()

In our case _GNU_SOURCE is not a symbol, but only a preprocessor define. I’m not sure what they’re trying to do with it here…

Linking it to libbsd solved the problem, seems the check for _GNU_SOURCE wasn’t the problem :slight_smile:

1 Like