OS X Dev environment: issues with target/fontconfig when building dependencies on macOS
#1
Got some issues with target/fontconfig during build with tools and dependencies (se snippet down below). Not sure if these issues are related to the build configuration or changes in the master. A distclean of fontconfig produced the same error. Any ideas?

macOS Catalina 10.15.7, Xcode 12.4, SDK MacOSX11.1
Kodi master 78f7d48b3c (Wed Oct 27 19:50:41 2021 +0100)

Snippet of some errors found in the log files "4.make-single-thread.log" and "5.make-single-thread-fontconfig-error.log" down below
cpp:
In file included from fcarch.c:24:
In file included from ./fcint.h:52:
./fcatomic.h:139:56: warning: 'OSAtomicAdd32Barrier' is deprecated: first deprecated in macOS 10.12 - Use atomic_fetch_add() from <stdatomic.h> instead [-Wdeprecated-declarations]
static inline int    FcRefInc      (FcRef *r) { return fc_atomic_int_add (r->count, +1); }
                                                       ^
./fcatomic.h:76:35: note: expanded from macro 'fc_atomic_int_add'
#define fc_atomic_int_add(AI, V)        (OSAtomicAdd32Barrier ((V), &(AI)) - (V))
                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/libkern/OSAtomicDeprecated.h:162:9: note: 'OSAtomicAdd32Barrier' has been explicitly marked deprecated here
int32_t OSAtomicAdd32Barrier( int32_t __theAmount, volatile int32_t *__theValue );
 

sh:
$ ./bootstrap
Full log "1.bootstrap.log" in https://pastebin.com/svA8muPq

sh:
$ ./configure --host=aarch64-apple-darwin --with-platform=macos
Full log "2.config.log" in https://pastebin.com/MUAVTZW0

sh:
$ make -j$(getconf _NPROCESSORS_ONLN)
.  .  .
.  .  .
10 warnings and 2 errors generated.
make[6]: *** [fcobjs.lo] Error 1
make[5]: *** [all] Error 2
make[4]: *** [all-recursive] Error 1
make[3]: *** [all] Error 2
make[2]: *** [macosx11.1_x86_64-target-debug/src/.libs/libfontconfig.a] Error 2
make[1]: *** [fontconfig] Error 2
make: *** [target/.installed-macosx11.1_x86_64-target-debug] Error 2
Full log "3.make.log" in https://tinyurl.com/5wh4vvpp [this is a link to google drive since 12 megs didn't fit into pastebin]

Run make single threaded
sh:

$ make
.  .  .
.  .  .
10 warnings and 2 errors generated.
make[6]: *** [fcobjs.lo] Error 1
make[5]: *** [all] Error 2
make[4]: *** [all-recursive] Error 1
make[3]: *** [all] Error 2
make[2]: *** [macosx11.1_x86_64-target-debug/src/.libs/libfontconfig.a] Error 2
make[1]: *** [fontconfig] Error 2
make: *** [target/.installed-macosx11.1_x86_64-target-debug] Error 2
Full log "4.make-single-thread.log" in https://pastebin.com/1Fjq1cmh

sh:
$ make -C target/fontconfig distclean
rm -rf macosx11.1_x86_64-target-debug .installed-macosx11.1_x86_64-target-debug

$ make
.  .  .
.  .  .
10 warnings and 2 errors generated.
make[6]: *** [fcobjs.lo] Error 1
make[5]: *** [all] Error 2
make[4]: *** [all-recursive] Error 1
make[3]: *** [all] Error 2
make[2]: *** [macosx11.1_x86_64-target-debug/src/.libs/libfontconfig.a] Error 2
make[1]: *** [fontconfig] Error 2
make: *** [target/.installed-macosx11.1_x86_64-target-debug] Error 2
Full log "5.make-single-thread-fontconfig-error.log" in https://pastebin.com/pE6whJn8
Reply
#2
Are there any macOS maintainers left on Team-Kodi that might give a hint what's wrong? Anyone?
Reply
#3
Perhaps @Fuzzard or @kambala can help.
Reply
#4
Apple silicon isn't supported currently.

Edit. The log shows your configure with x86_64, your post says aarch. Which is it?
Reply
#5
Below are some similar cases where someone argues that the problem is due to a newer version of gperf being installed. The question is whether one have to patch the toolchain and install a legacy version of gperf to make it all to work.

- https://bugs.freedesktop.org/show_bug.cgi?id=101280
https://github.com/spack/spack/issues/4546
https://www.mail-archive.com/blfs-suppor...04104.html
Reply
#6
Your setup looks fucked. Or your using some weird non Xcode defaults with homebrew or something. I'm in bed so can't look at full logs. I'll look later.

Master builds with Xcode 12.4, 12.5 and 11.3. I can guarantee that.
Reply
#7
No worries mate, sleep tight ;-)

I use both homebrew and ccache which perhaps might the culprit in this case. I'll try to reset/uninstall ccache and have a look if there is anything with homebrew (or the path) that interferes. Thanks for the tip!
Reply
#8
Ccache wont be the issue i wouldnt expect. I use it as well, and jenkins does too.

Your provided config.log doesnt complete. It fails to compile the ac test program. The strange stuff is the path of xcodebuild it finds (/Library/Developer/CommandLineTools/usr/bin/xcodebuild). Apple moved away from using Library a while ago, everything is inside the Xcode.app, which more importantly has all the sdk stuff required.

In your log the host_includes has no sysroot.
```
host_includes='-mmacosx-version-min=10.13 -isysroot '
```

in a working environment you should see something like the following

```
host_includes='-mmacosx-versionx-min=10.13 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk'
```
Reply
#9
I looked at your single thread log briefly, and it has sysroot. Im not sure if your giving incomplete, or mixed run logs or something. Kind of hard to find an issue when some things just dont add up.
Reply
#10
Testing with a brew installed gperf gets the failure.

Quick and dirty solution if you just want to move on is to brew uninstall gperf.

I'll look into a more longterm solution when i get some time.
Reply
#11
Try the following - https://github.com/fuzzard/xbmc/commit/2...fb553ebecf

Applies patch for open Fontconfig MR - https://gitlab.freedesktop.org/fontconfi...quests/178
Works in my VERY limited testing.
Reply
#12
Quote:Testing with a brew installed gperf gets the failure. Quick and dirty solution if you just want to move on is to brew uninstall gperf. I'll look into a more longterm solution when i get some time.

Correct, I've got the brew version of gperf installed so I'll remove it.

Another thing, since I recently upgraded xcode from 12.3 to 12.4 using the standalone installer it may have affected some search paths. But in this case "configure" is wrong because the program path "/Library/Developer/CommandLineTools/usr/bin/xcodebuild" does not exists (although the directory "/Library/Developer/CommandLineTools/usr/bin" does)

I plan to reinstall xcode using the online installer instead to se if that in any way will change things as search paths etc.
 
Quote:Fuzzard Wrote: 
Try the following - https://github.com/fuzzard/xbmc/commit/2...fb553ebecf

Applies patch for open Fontconfig MR - https://gitlab.freedesktop.org/fontconfi...quests/178
Works in my VERY limited testing.

That was quick but now it's my turn to go to bed so I'll test it tomorrow. Cheers and good night!
Reply
#13
also try using actual Xcode installation instead of command-line tools (but I guess for macOS target it doesn't really matter), change the location either via:
  • Xcode Preferences or sudo xcode-select -s <path to Xcode> in Terminal for a system-wide change
  • export DEVELOPER_DIR=<path to Xcode> for the current Terminal session
after that bootstrap, configure etc.
Reply
#14
I rebuilt everything from scratch using your patch and everything went through without any problems, thank you very much!

To avoid any possible collisions with Homebrew, I did reset the path to "PATH=/usr/bin:/bin:/usr/sbin:/sbin". I'll reinstall gperf with Homebrew again and then rebuild everything, this time using "/usr/local/bin" to see to see if there is any difference.

Regarding the built-in installer for the command line tools (xcode-select --install), it's possible that it makes other settings than the standalone version that you download yourself. But I did use "xcode-select -s" so there should really be no difference but you never know for sure. My current path according to xcode-select -p is "/Applications/Xcode.app/Contents/Developer".
Reply

Logout Mark Read Team Forum Stats Members Help
Dev environment: issues with target/fontconfig when building dependencies on macOS0