Building on macOS with Xcode 12, clang 12

Georgi Valkov gvalkov at abv.bg
Sun Sep 27 13:06:31 EDT 2020


Can anyone please add support for building on macOS with Xcode 12?
Starting with a fresh clone, the build process of some host tools like bc fails due to incorrect detection by autoconf:
For example, with Xcode 12 the build for bc fails because of the following line in config.h.
When building with Xcode 11 this line is commented out and everything compiles correctly.
#define ptrdiff_t size_t

The current workaround for building OpenWRT on macOS is to rename the /Applications/Xcode.app and copy Xcode 11 in its place.

Making all in bc
make[6]: Entering directory '/Volumes/test/openwrt/build_dir/host/bc-1.06.95/bc’
…
In file included from string.c:31:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/stddef.h:35:26: error: typedef redefinition with different types ('long' vs '__darwin_size_t' (aka 'unsigned long'))
typedef __PTRDIFF_TYPE__ ptrdiff_t;
                         ^
../config.h:121:19: note: expanded from macro 'ptrdiff_t'
#define ptrdiff_t size_t
                  ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_size_t.h:31:32: note: previous definition is here
typedef __darwin_size_t        size_t;


If anyone knows the maintainer of autoconf, please add them to this e-mail!

Georgi Valkov




More information about the openwrt-devel mailing list