Opened 16 months ago

Closed 16 months ago

Last modified 16 months ago

#5481 closed defect (duplicate)

GnuTLS build fails on macOS Mojave

Reported by: kali0ad Owned by:
Priority: Should Have Milestone:
Component: Build & Packages Keywords:
Cc: Patch:

Description (last modified by trompetin17)

I'm trying to follow the instructions here: https://trac.wildfiregames.com/wiki/BuildInstructions#OSX to build the game on my Mac.

The build fails during the ./build-osx-libs.sh -j3 command.

Below is a snippet of the output:

...
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether _XOPEN_SOURCE should be defined... no
checking for Minix Amsterdam compiler... no
checking for ar... ar
checking the archiver (ar) interface... ar
checking for ar... (cached) ar
checking for ranlib... ranlib
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking dependency style of clang... gcc3
checking the archiver (ar) interface... (cached) ar
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ accepts -g... yes
checking dependency style of clang++... gcc3
checking for bison... bison -y
checking for a sed that does not truncate output... /usr/bin/sed
checking for clang option to accept ISO C99... none needed
checking whether to build with code coverage support... no
checking whether to enable maintainer-specific portions of Makefiles... yes
checking for autogen... :
configure: WARNING:
***
*** autogen not found. Will not link against libopts.
***
checking for inline... inline
checking for ANSI C header files... (cached) yes
checking cpuid.h usability... yes
checking cpuid.h presence... yes
checking for cpuid.h... yes
checking for struct iovec.iov_basea... no
checking netinet/tcp.h usability... yes
checking netinet/tcp.h presence... yes
checking for netinet/tcp.h... yes
checking stdatomic.h usability... yes
checking stdatomic.h presence... yes
checking for stdatomic.h... yes
checking for getrandom... no
checking for getentropy... yes
checking for NETTLE... configure: error:
  ***
  *** Libnettle 3.1 was not found.

ERROR: GnuTLS build failed

After some Googling, it looks like this could be:

a) an issue with the --enable-shared flag (https://gitlab.com/gnutls/gnutls/blob/master/INSTALL.md#compilation)

b) an issue with libhogweed.so (https://stackoverflow.com/questions/9508851/how-to-compile-gnutls)

c) the path to libnettle (https://lists.gnupg.org/pipermail/gnutls-help/2016-July/004134.html)

d) something else

I also tried installing libnettle outside of 0ad with the directions here: http://www.linuxfromscratch.org/blfs/view/8.3-systemd/postlfs/nettle.html but was unable to install it. The configuration command runs fine, but sudo make install results in:

./install-sh -c -d /usr/share/info
f=nettle.info ; \
	[ -f $f ] || f="./$f" ; \
	/usr/bin/install -c -m 644 "$f" /usr/share/info ; \
	if (install-info --version && \
	    install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
	  install-info --info-dir="/usr/share/info" "$f" ; \
	else : ; fi
install: /usr/share/info/nettle.info: Operation not permitted
/usr/share/info/dir: Operation not permitted
make[1]: *** [install-info] Error 1
make: *** [install] Error 2

Anyone else able to build 0ad on a Mac successfully?

Change History (4)

comment:1 by wraitii, 16 months ago

Description: modified (diff)
Resolution: duplicate
Status: newclosed

Hey kali0ad. Thanks for reporting this. It is a duplicate of #5453 so I'm closing this ticket since #5453 is earlier.

Can you try https://trac.wildfiregames.com/ticket/5453#comment:7 ?

comment:2 by trompetin17, 16 months ago

Description: modified (diff)

Hi Kali0ad,

Yeah, I could build all in osx Mojave. could you add the log please, looks like that something was wrong when building nettle-3.4. I Im guessing because "Libnettle 3.1 was not found."

comment:3 by elexis, 16 months ago

Milestone: Alpha 24

comment:4 by historic_bruno, 16 months ago

In 22455:

Fixes GnuTLS build on macOS.
Fixes macOS linker warning "PIE disabled absolute - addressing not allowed".

Updates nettle to 3.5.1, GnuTLS to 3.6.8, gloox to 1.0.22.
Disables TCP fast open feature of GnuTLS (requires 10.11, no SDK build support).
Fixes GnuTLS detection of GMP by adding it to LIBS flag.
Disables getaddrinfo on gloox 1.0.22. Lobby connections failed during server hostname resolution.
Adds --with-pic to GMP build to force consistent PIC usage.
Adds -N flag to patch commands to avoid reapplying them.
Removes unneeded build flags.
Documents --enable-fat configure flag: GMP and nettle detect CPU-specific features, fat binaries let us build and run them on different CPUs (see D1772).

Fixes #5453, 5489. Refs #5481.
Tested by: kali0ad, trompetin17
Reviewed by: elexis, trompetin17

Differential Revision: ​https://code.wildfiregames.com/D2057

Note: See TracTickets for help on using tickets.