Hi all, I've this issue when trying to compile libgcrypt with +universal variant: Error: Target com.apple.build returned: shell command " cd "/opt/local/var/db/dports/build/_opt_local_var_db_dports_sources_rsync.rsync.darwinports.org_dpupdate_dports_devel_libgcrypt/work/libgcrypt-1.2.4" && make all " returned error 2 Command output: make all-recursive Making all in m4 make[2]: Nothing to be done for `all'. Making all in mpi make[2]: Nothing to be done for `all'. Making all in cipher make[2]: Nothing to be done for `all'. Making all in src /bin/sh ../libtool --tag=CC --mode=link /usr/bin/gcc-4.0 -O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc -Wall -L/opt/local/lib -arch i386 -arch ppc -o libgcrypt.la -rpath /opt/local/lib -version-info 13:3:2 libgcrypt_la-misc.lo libgcrypt_la-global.lo libgcrypt_la-sexp.lo libgcrypt_la-stdmem.lo libgcrypt_la-secmem.lo libgcrypt_la-missing-string.lo libgcrypt_la-module.lo libgcrypt_la-ath.lo ../cipher/libcipher.la ../mpi/libmpi.la -L/opt/local/lib -lgpg-error rm -fr .libs/libgcrypt.11.2.3.dylib .libs/libgcrypt.11.dylib .libs/libgcrypt.dylib .libs/libgcrypt.lax /usr/bin/gcc-4.0 -dynamiclib -flat_namespace -undefined suppress -o .libs/libgcrypt.11.2.3.dylib .libs/libgcrypt_la-misc.o .libs/libgcrypt_la-global.o .libs/libgcrypt_la-sexp.o .libs/libgcrypt_la-stdmem.o .libs/libgcrypt_la-secmem.o .libs/libgcrypt_la-missing-string.o .libs/libgcrypt_la-module.o .libs/libgcrypt_la-ath.o -all_load ../cipher/.libs/libcipher.a ../mpi/.libs/libmpi.a -L/opt/local/lib /opt/local/lib/libgpg-error.dylib /opt/local/lib/libintl.dylib /opt/local/lib/libiconv.dylib -install_name /opt/local/lib/libgcrypt.11.dylib -compatibility_version 14 -current_version 14.3 (cd .libs && rm -f libgcrypt.11.dylib && ln -s libgcrypt.11.2.3.dylib libgcrypt.11.dylib) (cd .libs && rm -f libgcrypt.dylib && ln -s libgcrypt.11.2.3.dylib libgcrypt.dylib) rm -fr .libs/libgcrypt.lax mkdir .libs/libgcrypt.lax rm -fr .libs/libgcrypt.lax/libcipher.a mkdir .libs/libgcrypt.lax/libcipher.a (cd .libs/libgcrypt.lax/libcipher.a && ar x /opt/local/var/db/dports/build/_opt_local_var_db_dports_sources_rsync.rsync.darwinports.org_dpupdate_dports_devel_libgcrypt/work/libgcrypt-1.2.4/src/../cipher/.libs/libcipher.a) ar: /opt/local/var/db/dports/build/_opt_local_var_db_dports_sources_rsync.rsync.darwinports.org_dpupdate_dports_devel_libgcrypt/work/libgcrypt-1.2.4/src/../cipher/.libs/libcipher.a is a fat file (use libtool(1) or lipo(1) and ar(1) on it) ar: /opt/local/var/db/dports/build/_opt_local_var_db_dports_sources_rsync.rsync.darwinports.org_dpupdate_dports_devel_libgcrypt/work/libgcrypt-1.2.4/src/../cipher/.libs/libcipher.a: Inappropriate file type or format make[2]: *** [libgcrypt.la] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 Compilation complains about an appropriate file type. Any idea? -- Philippe BERNERY
Near the end, it tries to extract files from the static lib, which fails because the lib is built for multiple architectures. In other words, the file format is correct insofar as it's being built +universal, but the port expects otherwise. This seems to be because the library builds itself as separate libraries, then takes them apart to build the single library. Weird. Anyway, I got the port to build +universal by adding this line to the Portfile (`port file libgcrypt`): variant universal { configure.args-append --disable-static } This disables the static libs that +universal is failing on, which is not a great fix, but I don't know if it can be improved on without a major patch. I also still can't guarantee that it will /work/ with +universal, so I'd be interested in hearing results of that too. (if it does, I'll commit that line to the official portfile) Chris On 06 Jun, 2007, at 12:04, Philippe BERNERY wrote:
Hi all,
I've this issue when trying to compile libgcrypt with +universal variant:
Error: Target com.apple.build returned: shell command " cd "/opt/local/var/db/dports/build/ _opt_local_var_db_dports_sources_rsync.rsync.darwinports.org_dpupdate_ dports_devel_libgcrypt/work/libgcrypt-1.2.4" && make all " returned error 2 Command output: make all-recursive Making all in m4 make[2]: Nothing to be done for `all'. Making all in mpi make[2]: Nothing to be done for `all'. Making all in cipher make[2]: Nothing to be done for `all'. Making all in src /bin/sh ../libtool --tag=CC --mode=link /usr/bin/gcc-4.0 -O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc -Wall -L/opt/local/lib -arch i386 -arch ppc -o libgcrypt.la -rpath /opt/local/lib -version-info 13:3:2 libgcrypt_la-misc.lo libgcrypt_la-global.lo libgcrypt_la-sexp.lo libgcrypt_la-stdmem.lo libgcrypt_la-secmem.lo libgcrypt_la-missing-string.lo libgcrypt_la-module.lo libgcrypt_la-ath.lo ../cipher/libcipher.la ../mpi/libmpi.la -L/opt/local/lib -lgpg-error rm -fr .libs/libgcrypt.11.2.3.dylib .libs/libgcrypt.11.dylib .libs/libgcrypt.dylib .libs/libgcrypt.lax /usr/bin/gcc-4.0 -dynamiclib -flat_namespace -undefined suppress -o .libs/libgcrypt.11.2.3.dylib .libs/libgcrypt_la-misc.o .libs/libgcrypt_la-global.o .libs/libgcrypt_la-sexp.o .libs/libgcrypt_la-stdmem.o .libs/libgcrypt_la-secmem.o .libs/libgcrypt_la-missing-string.o .libs/libgcrypt_la-module.o .libs/libgcrypt_la-ath.o -all_load ../cipher/.libs/libcipher.a ../mpi/.libs/libmpi.a -L/opt/local/lib /opt/local/lib/libgpg-error.dylib /opt/local/lib/libintl.dylib /opt/local/lib/libiconv.dylib -install_name /opt/local/lib/libgcrypt.11.dylib -compatibility_version 14 -current_version 14.3 (cd .libs && rm -f libgcrypt.11.dylib && ln -s libgcrypt.11.2.3.dylib libgcrypt.11.dylib) (cd .libs && rm -f libgcrypt.dylib && ln -s libgcrypt.11.2.3.dylib libgcrypt.dylib) rm -fr .libs/libgcrypt.lax mkdir .libs/libgcrypt.lax rm -fr .libs/libgcrypt.lax/libcipher.a mkdir .libs/libgcrypt.lax/libcipher.a (cd .libs/libgcrypt.lax/libcipher.a && ar x /opt/local/var/db/dports/build/ _opt_local_var_db_dports_sources_rsync.rsync.darwinports.org_dpupdate_ dports_devel_libgcrypt/work/libgcrypt-1.2.4/src/../cipher/.libs/ libcipher.a) ar: /opt/local/var/db/dports/build/ _opt_local_var_db_dports_sources_rsync.rsync.darwinports.org_dpupdate_ dports_devel_libgcrypt/work/libgcrypt-1.2.4/src/../cipher/.libs/ libcipher.a is a fat file (use libtool(1) or lipo(1) and ar(1) on it) ar: /opt/local/var/db/dports/build/ _opt_local_var_db_dports_sources_rsync.rsync.darwinports.org_dpupdate_ dports_devel_libgcrypt/work/libgcrypt-1.2.4/src/../cipher/.libs/ libcipher.a: Inappropriate file type or format make[2]: *** [libgcrypt.la] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2
Compilation complains about an appropriate file type. Any idea?
-- Philippe BERNERY
I tried it. It seems to compile good however I typed: otool -f libgcrypt.11.2.3.dylib to check if the file was correctly generated, but the command returned nothing. Is that good ? -- Philippe BERNERY
On 06 Jun, 2007, at 13:20, Philippe BERNERY wrote:
I tried it. It seems to compile good however I typed:
otool -f libgcrypt.11.2.3.dylib
to check if the file was correctly generated, but the command returned nothing. Is that good ?
I don't believe so. I'm not experienced with universal builds, but I'm pretty sure that if it were really universal it would have printed something. This may be one of those ports that needs special work done to it. Chris
On Jun 6, 2007, at 11:43, Chris Pickel wrote:
Near the end, it tries to extract files from the static lib, which fails because the lib is built for multiple architectures. In other words, the file format is correct insofar as it's being built +universal, but the port expects otherwise.
This seems to be because the library builds itself as separate libraries, then takes them apart to build the single library. Weird. Anyway, I got the port to build +universal by adding this line to the Portfile (`port file libgcrypt`):
variant universal { configure.args-append --disable-static }
This disables the static libs that +universal is failing on, which is not a great fix, but I don't know if it can be improved on without a major patch. I also still can't guarantee that it will / work/ with +universal, so I'd be interested in hearing results of that too. (if it does, I'll commit that line to the official portfile)
Doesn't redefining "variant universal" like that _overwrite_ the default universal variant MacPorts provides, thereby making it no longer attempt to build anything universal?
On 06 Jun, 2007, at 15:02, Ryan Schmidt wrote:
On Jun 6, 2007, at 11:43, Chris Pickel wrote:
variant universal { configure.args-append --disable-static }
Doesn't redefining "variant universal" like that _overwrite_ the default universal variant MacPorts provides, thereby making it no longer attempt to build anything universal?
Hmm, yes, that's probably true. As I said, I'm not experienced with +universal. I changed it by putting the following into "platform darwin 8" (on the assumption that anyone that currently wants +universal is on that platform). if {[variant_isset universal]} { configure.args-append --disable-static } No dice. It looks like it's building some arch-specific libs, which fail when it looks to assemble a universal lib. But for future reference, is there a cleaner way to make a small change like that to the universal variant? Chris
On Jun 6, 2007, at 14:23, Chris Pickel wrote:
On 06 Jun, 2007, at 15:02, Ryan Schmidt wrote:
On Jun 6, 2007, at 11:43, Chris Pickel wrote:
variant universal { configure.args-append --disable-static }
Doesn't redefining "variant universal" like that _overwrite_ the default universal variant MacPorts provides, thereby making it no longer attempt to build anything universal?
Hmm, yes, that's probably true. As I said, I'm not experienced with +universal.
I changed it by putting the following into "platform darwin 8" (on the assumption that anyone that currently wants +universal is on that platform).
if {[variant_isset universal]} { configure.args-append --disable-static }
No dice. It looks like it's building some arch-specific libs, which fail when it looks to assemble a universal lib. But for future reference, is there a cleaner way to make a small change like that to the universal variant?
If you need to add to the default universal variant, rather than replace it entirely, you could probably do something like the above in pre-configure. That would probably be a good place. Doing it in the darwin 8 platform is not great, because while you need 10.4 or later to do universal, somebody might be running a pre-release of 10.5.
I tried to add if {[variant_isset universal]} { configure.args-append --disable-static } but I get the following output: Portfile changed since last build; discarding previous state. ---> Fetching libgcrypt ---> Verifying checksum(s) for libgcrypt ---> Extracting libgcrypt ---> Configuring libgcrypt ---> Building libgcrypt with target all Error: Target com.apple.build returned: shell command " cd "/opt/local/var/db/dports/build/_opt_local_var_db_dports_sources_rsync.rsync.darwinports.org_dpupdate_dports_devel_libgcrypt/work/libgcrypt-1.2.4" && make all " returned error 2 Command output: /usr/bin/gcc-4.0 -dynamiclib -flat_namespace -undefined suppress -o .libs/libgcrypt.11.2.3.dylib .libs/libgcrypt_la-misc.o .libs/libgcrypt_la-global.o .libs/libgcrypt_la-sexp.o .libs/libgcrypt_la-stdmem.o .libs/libgcrypt_la-secmem.o .libs/libgcrypt_la-missing-string.o .libs/libgcrypt_la-module.o .libs/libgcrypt_la-ath.o -all_load ../cipher/.libs/libcipher.a ../mpi/.libs/libmpi.a -L/opt/local/lib /opt/local/lib/libgpg-error.dylib /opt/local/lib/libintl.dylib /opt/local/lib/libiconv.dylib -install_name /opt/local/lib/libgcrypt.11.dylib -compatibility_version 14 -current_version 14.3 (cd .libs && rm -f libgcrypt.11.dylib && ln -s libgcrypt.11.2.3.dylib libgcrypt.11.dylib) (cd .libs && rm -f libgcrypt.dylib && ln -s libgcrypt.11.2.3.dylib libgcrypt.dylib) creating libgcrypt.la (cd .libs && rm -f libgcrypt.la && ln -s ../libgcrypt.la libgcrypt.la) Making all in doc make[2]: Nothing to be done for `all'. Making all in tests /usr/bin/gcc-4.0 -DHAVE_CONFIG_H -I. -I. -I.. -I../src -I/opt/local/include -I/opt/local/include -O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc -Wall -c prime.c /bin/sh ../libtool --tag=CC --mode=link /usr/bin/gcc-4.0 -I/opt/local/include -O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc -Wall -L/opt/local/lib -arch i386 -arch ppc -o prime prime.o ../src/libgcrypt.la mkdir .libs /usr/bin/gcc-4.0 -I/opt/local/include -O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc -Wall -arch i386 -arch ppc -o .libs/prime prime.o -L/opt/local/lib ../src/.libs/libgcrypt.dylib /opt/local/lib/libgpg-error.dylib /opt/local/lib/libintl.dylib /opt/local/lib/libiconv.dylib -lc /usr/bin/ld: for architecture ppc /usr/bin/ld: warning ../src/.libs/libgcrypt.dylib cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded) /usr/bin/ld: warning prebinding disabled because dependent library: /Developer/SDKs/MacOSX10.4u.sdk/opt/local/lib/libgpg-error.0.dylib is not prebound /usr/bin/ld: Undefined symbols: _gcry_check_version _gcry_control _gcry_mpi_add_ui _gcry_mpi_dump _gcry_mpi_release _gcry_prime_check _gcry_prime_generate _gcry_prime_group_generator _gcry_prime_release_factors collect2: ld returned 1 exit status lipo: can't open input file: /var/tmp//ccapeII6.out (No such file or directory) make[2]: *** [prime] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 -- Philippe BERNERY
On Jun 7, 2007, at 03:32, Philippe BERNERY wrote:
I tried to add
if {[variant_isset universal]} { configure.args-append --disable-static }
but I get the following output:
Portfile changed since last build; discarding previous state. ---> Fetching libgcrypt ---> Verifying checksum(s) for libgcrypt ---> Extracting libgcrypt ---> Configuring libgcrypt ---> Building libgcrypt with target all Error: Target com.apple.build returned: shell command " cd "/opt/local/var/db/dports/build/ _opt_local_var_db_dports_sources_rsync.rsync.darwinports.org_dpupdate_ dports_devel_libgcrypt/work/libgcrypt-1.2.4" && make all " returned error 2 Command output: /usr/bin/gcc-4.0 -dynamiclib -flat_namespace -undefined suppress -o .libs/libgcrypt.11.2.3.dylib .libs/libgcrypt_la-misc.o .libs/libgcrypt_la-global.o .libs/libgcrypt_la-sexp.o .libs/libgcrypt_la-stdmem.o .libs/libgcrypt_la-secmem.o .libs/libgcrypt_la-missing-string.o .libs/libgcrypt_la-module.o .libs/libgcrypt_la-ath.o -all_load ../cipher/.libs/libcipher.a ../mpi/.libs/libmpi.a -L/opt/local/lib /opt/local/lib/libgpg-error.dylib /opt/local/lib/libintl.dylib /opt/local/lib/libiconv.dylib -install_name /opt/local/lib/libgcrypt.11.dylib -compatibility_version 14 -current_version 14.3 (cd .libs && rm -f libgcrypt.11.dylib && ln -s libgcrypt.11.2.3.dylib libgcrypt.11.dylib) (cd .libs && rm -f libgcrypt.dylib && ln -s libgcrypt.11.2.3.dylib libgcrypt.dylib) creating libgcrypt.la (cd .libs && rm -f libgcrypt.la && ln -s ../libgcrypt.la libgcrypt.la) Making all in doc make[2]: Nothing to be done for `all'. Making all in tests /usr/bin/gcc-4.0 -DHAVE_CONFIG_H -I. -I. -I.. -I../src -I/opt/local/include -I/opt/local/include -O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc -Wall -c prime.c /bin/sh ../libtool --tag=CC --mode=link /usr/bin/gcc-4.0 -I/opt/local/include -O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc -Wall -L/opt/local/lib -arch i386 -arch ppc -o prime prime.o ../src/libgcrypt.la mkdir .libs /usr/bin/gcc-4.0 -I/opt/local/include -O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc -Wall -arch i386 -arch ppc -o .libs/prime prime.o -L/opt/local/lib ../src/.libs/libgcrypt.dylib /opt/local/lib/libgpg-error.dylib /opt/local/lib/libintl.dylib /opt/local/lib/libiconv.dylib -lc /usr/bin/ld: for architecture ppc /usr/bin/ld: warning ../src/.libs/libgcrypt.dylib cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded) /usr/bin/ld: warning prebinding disabled because dependent library: /Developer/SDKs/MacOSX10.4u.sdk/opt/local/lib/libgpg-error.0.dylib is not prebound /usr/bin/ld: Undefined symbols: _gcry_check_version _gcry_control _gcry_mpi_add_ui _gcry_mpi_dump _gcry_mpi_release _gcry_prime_check _gcry_prime_generate _gcry_prime_group_generator _gcry_prime_release_factors collect2: ld returned 1 exit status lipo: can't open input file: /var/tmp//ccapeII6.out (No such file or directory) make[2]: *** [prime] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2
Ok, so it sounds like libgcrypt is going to need more help to build universal. You may want to open a ticket in Trac and assign it to the port's maintainer.
Done, I opened a ticket: http://trac.macports.org/projects/macports/ticket/12083 Thanks for your help.
participants (3)
-
Chris Pickel
-
Philippe BERNERY
-
Ryan Schmidt