Skip to content

Failure to build libdragon from source on macOS due to defined (__APPLE__) check #806

@mark-rushakoff

Description

@mark-rushakoff

I built from source on macOS (M1 Mac, Sequoia 15.5) following Option 3. At first I was having issues with build-toolchain.sh due to the system default gcc and g++, but once I set CC=/opt/homebrew/bin/gcc-14 and CXX=/opt/homebrew/bin/g++-14, I was able to build the toolchain successfully.

But then when I tried to run build.sh, I got failures in building the audioconv64 tree. In particular, mips64-elf-gcc was complaining about __private_extern__, which I traced to this macro:

#ifdef HAVE_VISIBILITY
#define LIBSAMPLERATE_DLL_PRIVATE __attribute__ ((visibility ("hidden")))
#elif defined (__APPLE__)
#define LIBSAMPLERATE_DLL_PRIVATE __private_extern__
#else
#define LIBSAMPLERATE_DLL_PRIVATE
#endif

I deleted the #elif defined (__APPLE__) clause and then I was able to complete build.sh successfully. I'm not sure if that is actually the right fix -- maybe that check does belong in general? But when using mips64-elf-gcc it doesn't seem like that clause should ever apply.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions