larsschwegmann larsschwegmann - 5 months ago 13
iOS Question

Error while compiling GnuPG for iOS Simulator + iOS

So I've stumbled across this link today: https://github.com/jmstone617/gnutls-gpg-gpgme-for-ios

Now I want to compile the static framework for both the iOS Simulator and the Device. I'm running OS X Yosemite beta 3 and have Xcode 5 as well as Xcode 6 beta 3 installed. I am using the Developer tools of Xcode 6. I also modified the

SDKVERSION
flag inside
build-pgp.sh
to
8.0
, since I want to compile for the beta. When running
sudo ./build-gpg.sh
, it finishes really fast but doesn't compile anything.

This is the shell script output:

Downloading gnupg-1.4.16.tar.bz2
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3571k 100 3571k 0 0 984k 0 0:00:03 0:00:03 --:--:-- 984k

Building gnupg for iPhoneSimulator 8.0 i386
Follow the build log with: tail -f /Users/lars/Documents/Development/SecureMailIOS/gnutls-gpg-gpgme-for-ios/bin/iPhoneSimulator8.0-i386.sdk/build-gnupg-1.4.16.log
Please stand by...


When looking at the log file, I saw this:

checking build system type... x86_64-apple-darwin14.0.0
checking host system type... i386-apple-darwin
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for i386-apple-darwin-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... scripts/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
configure: autobuild project... gnupg
configure: autobuild revision... 1.4.16
configure: autobuild hostname... GLaDOS
configure: autobuild timestamp... 20140717-002358
checking for style of include used by make... GNU
checking for i386-apple-darwin-gcc... /Applications/Xcode6-Beta3.app/Contents/Developer/usr/bin/gcc -arch i386 -fheinous-gnu-extensions
checking whether the C compiler works... no
configure: error: in `/Users/lars/Documents/Development/SecureMailIOS/gnutls-gpg-gpgme-for-ios/src/gnupg-1.4.16':
configure: error: C compiler cannot create executables
See `config.log' for more details
checking build system type... x86_64-apple-darwin14.0.0
checking host system type... i386-apple-darwin
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for i386-apple-darwin-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... scripts/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
configure: autobuild project... gnupg
configure: autobuild revision... 1.4.16
configure: autobuild hostname... GLaDOS
configure: autobuild timestamp... 20140717-004756
checking for style of include used by make... GNU
checking for i386-apple-darwin-gcc... /Applications/Xcode6-Beta3.app/Contents/Developer/usr/bin/gcc -arch i386 -fheinous-gnu-extensions
checking whether the C compiler works... no
configure: error: in `/Users/lars/Documents/Development/SecureMailIOS/gnutls-gpg-gpgme-for-ios/src/gnupg-1.4.16':
configure: error: C compiler cannot create executables
See `config.log' for more details


Looking inside
config.log
I saw this:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by gnupg configure 1.4.16, which was
generated by GNU Autoconf 2.69. Invocation command line was

$ ./configure --host=i386-apple-darwin --prefix=/Users/lars/Documents/Development/SecureMailIOS/gnutls-gpg-gpgme-for-ios/bin/iPhoneSimulator8.0-i386.sdk --disable-dependency-tracking

## --------- ##
## Platform. ##
## --------- ##

hostname = GLaDOS
uname -m = x86_64
uname -r = 14.0.0
uname -s = Darwin
uname -v = Darwin Kernel Version 14.0.0: Mon Jun 30 11:54:42 PDT 2014; root:xnu-2782.1.20~3/RELEASE_X86_64

/usr/bin/uname -p = i386
/bin/uname -X = unknown

/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = Mach kernel version:
Darwin Kernel Version 14.0.0: Mon Jun 30 11:54:42 PDT 2014; root:xnu-2782.1.20~3/RELEASE_X86_64
Kernel configured for up to 8 processors.
4 processors are physically available.
8 processors are logically available.
Processor type: i486 (Intel 80486)
Processors active: 0 1 2 3 4 5 6 7
Primary memory available: 8.00 gigabytes
Default processor set: 241 tasks, 1056 threads, 8 processors
Load average: 2.19, Mach factor: 5.80
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown

PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /usr/local/MacGPG2/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2744: checking build system type
configure:2758: result: x86_64-apple-darwin14.0.0
configure:2778: checking host system type
configure:2791: result: i386-apple-darwin
configure:2827: checking for a BSD-compatible install
configure:2895: result: /usr/bin/install -c
configure:2906: checking whether build environment is sane
configure:2956: result: yes
configure:3005: checking for i386-apple-darwin-strip
configure:3035: result: no
configure:3045: checking for strip
configure:3061: found /usr/bin/strip
configure:3072: result: strip
configure:3097: checking for a thread-safe mkdir -p
configure:3136: result: scripts/install-sh -c -d
configure:3149: checking for gawk
configure:3179: result: no
configure:3149: checking for mawk
configure:3179: result: no
configure:3149: checking for nawk
configure:3179: result: no
configure:3149: checking for awk
configure:3165: found /usr/bin/awk
configure:3176: result: awk
configure:3187: checking whether make sets $(MAKE)
configure:3209: result: yes
configure:3293: autobuild project... gnupg
configure:3295: autobuild revision... 1.4.16
configure:3299: autobuild hostname... GLaDOS
configure:3308: autobuild timestamp... 20140717-004756
configure:3327: checking for style of include used by make
configure:3355: result: GNU
configure:3386: checking for i386-apple-darwin-gcc
configure:3413: result: /Applications/Xcode6-Beta3.app/Contents/Developer/usr/bin/gcc -arch i386 -fheinous-gnu-extensions
configure:3682: checking for C compiler version
configure:3691: /Applications/Xcode6-Beta3.app/Contents/Developer/usr/bin/gcc -arch i386 -fheinous-gnu-extensions --version >&5
Apple LLVM version 6.0 (clang-600.0.38) (based on LLVM 3.5svn)
Target: i386-apple-darwin14.0.0
Thread model: posix
configure:3702: $? = 0
configure:3691: /Applications/Xcode6-Beta3.app/Contents/Developer/usr/bin/gcc -arch i386 -fheinous-gnu-extensions -v >&5
Apple LLVM version 6.0 (clang-600.0.38) (based on LLVM 3.5svn)
Target: i386-apple-darwin14.0.0
Thread model: posix
clang: warning: argument unused during compilation: '-fheinous-gnu-extensions'
configure:3702: $? = 0
configure:3691: /Applications/Xcode6-Beta3.app/Contents/Developer/usr/bin/gcc -arch i386 -fheinous-gnu-extensions -V >&5
clang: error: argument to '-V' is missing (expected 1 value)
clang: error: no input files
configure:3702: $? = 1
configure:3691: /Applications/Xcode6-Beta3.app/Contents/Developer/usr/bin/gcc -arch i386 -fheinous-gnu-extensions -qversion >&5
clang: error: unknown argument: '-qversion'
clang: error: no input files
configure:3702: $? = 1
configure:3722: checking whether the C compiler works
configure:3744: /Applications/Xcode6-Beta3.app/Contents/Developer/usr/bin/gcc -arch i386 -fheinous-gnu-extensions -arch i386 -pipe -no-cpp-precomp -isysroot /Applications/Xcode6-Beta3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk -I/Users/lars/Documents/Development/SecureMailIOS/gnutls-gpg-gpgme-for-ios/include -arch i386 -pipe -no-cpp-precomp -isysroot /Applications/Xcode6-Beta3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk -L/usr/local/opt/gcc48/lib conftest.c >&5
ld: warning: directory not found for option '-L/usr/local/opt/gcc48/lib'
ld: building for MacOSX, but linking against dylib built for iOS Simulator file '/Applications/Xcode6-Beta3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk/usr/lib/libSystem.dylib' for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:3748: $? = 1
configure:3786: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "gnupg"
| #define PACKAGE_TARNAME "gnupg"
| #define PACKAGE_VERSION "1.4.16"
| #define PACKAGE_STRING "gnupg 1.4.16"
| #define PACKAGE_BUGREPORT "http://bugs.gnupg.org"
| #define PACKAGE_URL ""
| #define PACKAGE "gnupg"
| #define VERSION "1.4.16"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3791: error: in `/Users/lars/Documents/Development/SecureMailIOS/gnutls-gpg-gpgme-for-ios/src/gnupg-1.4.16':
configure:3793: error: C compiler cannot create executables
See `config.log' for more details

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=x86_64-apple-darwin14.0.0
ac_cv_env_CCASFLAGS_set=
ac_cv_env_CCASFLAGS_value=
ac_cv_env_CCAS_set=
ac_cv_env_CCAS_value=
ac_cv_env_CC_FOR_BUILD_set=
ac_cv_env_CC_FOR_BUILD_value=
ac_cv_env_CC_set=set
ac_cv_env_CC_value='/Applications/Xcode6-Beta3.app/Contents/Developer/usr/bin/gcc -arch i386 -fheinous-gnu-extensions'
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-arch i386 -pipe -no-cpp-precomp -isysroot /Applications/Xcode6-Beta3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk -I/Users/lars/Documents/Development/SecureMailIOS/gnutls-gpg-gpgme-for-ios/include'
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value='-arch i386 -pipe -no-cpp-precomp -isysroot /Applications/Xcode6-Beta3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk -L/usr/local/opt/gcc48/lib'
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=set
ac_cv_env_host_alias_value=i386-apple-darwin
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=i386-apple-darwin
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AWK=awk
ac_cv_prog_CC='/Applications/Xcode6-Beta3.app/Contents/Developer/usr/bin/gcc -arch i386 -fheinous-gnu-extensions'
ac_cv_prog_ac_ct_STRIP=strip
ac_cv_prog_make_make_set=yes

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL='${SHELL} /Users/lars/Documents/Development/SecureMailIOS/gnutls-gpg-gpgme-for-ios/src/gnupg-1.4.16/scripts/missing --run aclocal-1.11'
ALLOCA=''
AMDEPBACKSLASH=''
AMDEP_FALSE=''
AMDEP_TRUE='#'
AMTAR='$${TAR-tar}'
AR='/Applications/Xcode6-Beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar'
AUTOCONF='${SHELL} /Users/lars/Documents/Development/SecureMailIOS/gnutls-gpg-gpgme-for-ios/src/gnupg-1.4.16/scripts/missing --run autoconf'
AUTOHEADER='${SHELL} /Users/lars/Documents/Development/SecureMailIOS/gnutls-gpg-gpgme-for-ios/src/gnupg-1.4.16/scripts/missing --run autoheader'
AUTOMAKE='${SHELL} /Users/lars/Documents/Development/SecureMailIOS/gnutls-gpg-gpgme-for-ios/src/gnupg-1.4.16/scripts/missing --run automake-1.11'
AWK='awk'
BUILD_INCLUDED_LIBINTL=''
CAPLIBS=''
CATOBJEXT=''
CC='/Applications/Xcode6-Beta3.app/Contents/Developer/usr/bin/gcc -arch i386 -fheinous-gnu-extensions'
CCAS=''
CCASDEPMODE=''
CCASFLAGS=''
CCDEPMODE=''
CC_FOR_BUILD=''
CFLAGS='-arch i386 -pipe -no-cpp-precomp -isysroot /Applications/Xcode6-Beta3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk -I/Users/lars/Documents/Development/SecureMailIOS/gnutls-gpg-gpgme-for-ios/include'
CFLAG_VISIBILITY=''
CPP=''
CPPFLAGS=''
CROSS_COMPILING_FALSE=''
CROSS_COMPILING_TRUE=''
CYGPATH_W='echo'
DATADIRNAME=''
DEFS=''
DEPDIR='.deps'
DLLIBS=''
DNSLIBS=''
DOCBOOK_TO_MAN=''
ECHO_C='\c'
ECHO_N=''
ECHO_T=''
EGREP=''
ENABLE_AGENT_SUPPORT_FALSE=''
ENABLE_AGENT_SUPPORT_TRUE=''
ENABLE_BZIP2_SUPPORT_FALSE=''
ENABLE_BZIP2_SUPPORT_TRUE=''
ENABLE_CARD_SUPPORT_FALSE=''
ENABLE_CARD_SUPPORT_TRUE=''
ENABLE_LOCAL_ZLIB_FALSE=''
ENABLE_LOCAL_ZLIB_TRUE=''
ENABLE_SELINUX_HACKS_FALSE=''
ENABLE_SELINUX_HACKS_TRUE=''
EXEEXT=''
FAKE_CURL_FALSE=''
FAKE_CURL_TRUE=''
GENCAT=''
GETOPT=''
GETTEXT_MACRO_VERSION=''
GLIBC21=''
GLIBC2=''
GMSGFMT=''
GMSGFMT_015=''
GPGKEYS_CURL=''
GPGKEYS_FINGER=''
GPGKEYS_HKP=''
GPGKEYS_LDAP=''
GPGKEYS_MAILTO=''
GREP=''
HAVE_ASPRINTF=''
HAVE_DOCBOOK_TO_MAN_FALSE=''
HAVE_DOCBOOK_TO_MAN_TRUE=''
HAVE_DOSISH_SYSTEM_FALSE=''
HAVE_DOSISH_SYSTEM_TRUE=''
HAVE_NEWLOCALE=''
HAVE_POSIX_PRINTF=''
HAVE_SHM_FALSE=''
HAVE_SHM_TRUE=''
HAVE_SNPRINTF=''
HAVE_USTAR_FALSE=''
HAVE_USTAR_TRUE=''
HAVE_VISIBILITY=''
HAVE_W32_SYSTEM_FALSE=''
HAVE_W32_SYSTEM_TRUE=''
HAVE_WPRINTF=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
INSTOBJEXT=''
INTLBISON=''
INTLLIBS=''
INTLOBJS=''
INTL_DEFAULT_VERBOSITY=''
INTL_LIBTOOL_SUFFIX_PREFIX=''
INTL_MACOSX_LIBS=''
LDAPLIBS=''
LDAP_CPPFLAGS=''
LDFLAGS='-arch i386 -pipe -no-cpp-precomp -isysroot /Applications/Xcode6-Beta3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk -L/usr/local/opt/gcc48/lib'
LIBCURL=''
LIBCURL_CPPFLAGS=''
LIBICONV=''
LIBINTL=''
LIBMULTITHREAD=''
LIBOBJS=''
LIBPTH=''
LIBPTH_PREFIX=''
LIBREADLINE=''
LIBS=''
LIBTHREAD=''
LIBUSB=''
LIBUSB_CPPFLAGS=''
LTLIBC=''
LTLIBICONV=''
LTLIBINTL=''
LTLIBMULTITHREAD=''
LTLIBOBJS=''
LTLIBPTH=''
LTLIBTHREAD=''
MAINT=''
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE=''
MAKEINFO='${SHELL} /Users/lars/Documents/Development/SecureMailIOS/gnutls-gpg-gpgme-for-ios/src/gnupg-1.4.16/scripts/missing --run makeinfo'
MKDIR_P='scripts/install-sh -c -d'
MPI_EXTRA_ASM_OBJS=''
MPI_OPT_FLAGS=''
MPI_SFLAGS=''
MSGFMT=''
MSGFMT_015=''
MSGMERGE=''
NETLIBS=''
NM='/Applications/Xcode6-Beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm'
NOEXECSTACK_FLAGS=''
OBJEXT=''
PACKAGE='gnupg'
PACKAGE_BUGREPORT='http://bugs.gnupg.org'
PACKAGE_NAME='gnupg'
PACKAGE_STRING='gnupg 1.4.16'
PACKAGE_TARNAME='gnupg'
PACKAGE_URL=''
PACKAGE_VERSION='1.4.16'
PATH_SEPARATOR=':'
PERL=''
POSUB=''
PRI_MACROS_BROKEN=''
RANLIB='/Applications/Xcode6-Beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib'
SENDMAIL=''
SET_MAKE=''
SHELL='/bin/sh'
STRIP='strip'
TAR=''
USE_DNS_SRV_FALSE=''
USE_DNS_SRV_TRUE=''
USE_INCLUDED_LIBINTL=''
USE_INTERNAL_REGEX_FALSE=''
USE_INTERNAL_REGEX_TRUE=''
USE_NLS=''
USE_RNDEGD_FALSE=''
USE_RNDEGD_TRUE=''
USE_RNDLINUX_FALSE=''
USE_RNDLINUX_TRUE=''
USE_RNDUNIX_FALSE=''
USE_RNDUNIX_TRUE=''
USE_RNDW32_FALSE=''
USE_RNDW32_TRUE=''
USE_SHA512_FALSE=''
USE_SHA512_TRUE=''
USE_SIMPLE_GETTEXT_FALSE=''
USE_SIMPLE_GETTEXT_TRUE=''
VERSION='1.4.16'
W32LIBS=''
WINDRES=''
WOE32=''
WOE32DLL=''
XGETTEXT=''
XGETTEXT_015=''
XGETTEXT_EXTRA_OPTIONS=''
ZLIBS=''
_libcurl_config=''
_usb_config=''
ac_ct_CC=''
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__fastdepCCAS_FALSE=''
am__fastdepCCAS_TRUE=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__include='include'
am__isrc=''
am__leading_dot='.'
am__nodep=''
am__quote=''
am__tar='$${TAR-tar} chof - "$$tardir"'
am__untar='$${TAR-tar} xf -'
bindir='${exec_prefix}/bin'
build='x86_64-apple-darwin14.0.0'
build_alias=''
build_cpu='x86_64'
build_os='darwin14.0.0'
build_vendor='apple'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host='i386-apple-darwin'
host_alias='i386-apple-darwin'
host_cpu='i386'
host_os='darwin'
host_vendor='apple'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /Users/lars/Documents/Development/SecureMailIOS/gnutls-gpg-gpgme-for-ios/src/gnupg-1.4.16/scripts/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p='$(top_builddir)/scripts/install-sh -c -d'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/Users/lars/Documents/Development/SecureMailIOS/gnutls-gpg-gpgme-for-ios/bin/iPhoneSimulator8.0-i386.sdk'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "gnupg"
#define PACKAGE_TARNAME "gnupg"
#define PACKAGE_VERSION "1.4.16"
#define PACKAGE_STRING "gnupg 1.4.16"
#define PACKAGE_BUGREPORT "http://bugs.gnupg.org"
#define PACKAGE_URL ""
#define PACKAGE "gnupg"
#define VERSION "1.4.16"

configure: exit 77


I tried changing my command line tools to the old Xcode 5 installation and set the
SDKVERSION
back to iOS 7, but that gave me the same error.

I don't really see where the problem lies here, so I'd appreciate any help I can get!
Thanks in advance!

Answer

Edit the file build-gpg.sh and change line number 87 from:

export LDFLAGS="-arch ${ARCH} -pipe -no-cpp-precomp -isysroot ${BUILD_SDKROOT} -L/usr/local/opt/gcc48/lib"

to:

export LDFLAGS="-arch ${ARCH} -pipe -no-cpp-precomp -isysroot ${BUILD_SDKROOT} -L/usr/local/opt/gcc48/lib -miphoneos-version-min=7.0"

i.e. add -miphoneos-version-min=7.0 to the end.

Before you run build-gpg.sh again make sure you delete the src directory (if it exists) to create a clean build.

Also:

  1. Run build-libgpg-error.sh before running build-gpg.sh.
  2. Change the last cp command in build-gpg.sh from include/g to include/*.