Page 1 of 1

fail to compile with Xcode 4.2 mac os x 10.7.2

Posted: Sun Oct 16, 2011 12:33 pm
by lamahk
Please help:

I was able to compile with Xcode 4.1 with mac os x 10.7.1 from source checkout from trunk@4270 but I failed to after upgrading Xcode to 4.2 and mac os x 10.7.2

Code: Select all

** BUILD FAILED **


The following build commands failed:
        ExternalBuildToolExecution external
(1 failure)
make: *** [macosx.build] Error 65
build/log/build.txt show

Code: Select all

make[1]: *** [contrib/libogg/.stamp.configure] Error 1
make[1]: *** Waiting for unfinished jobs....
Even I updated to the latest trunk@git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4292
It still failed at. Further checking find the error happened at build/contrib/libogg/libogg

Dump of config.log as follow

Code: Select all

configure:19812: checking size of short
configure:20124: /Developer/usr/bin/gcc -o conftest -fno-common -O4 -Wall -fsigned-char -ffast-math -arch x86_64 -arch x86_64 -arch x86_64 conftest.c  >&5
ld: lto: could not merge in /var/folders/wt/vsqts30d37v52yb_glqc8zsc0000gp/T//cch1Qrnj.o because Unknown instruction for architecture x86_64
collect2: ld returned 1 exit status
configure:20127: $? = 1
configure: program exited with status 1
configure: failed program was:
| /* confdefs.h.  */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE "libogg"
| #define VERSION "1.1.3"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #ifdef __cplusplus
| extern "C" void exit (int);
| #endif
| #define STDC_HEADERS 1
| /* end confdefs.h.  */
| #include <stdio.h>
| #if HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #if HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #if STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # if HAVE_STDLIB_H
| #  include <stdlib.h>
| # endif
| #endif
| #if HAVE_STRING_H
| # if !STDC_HEADERS && HAVE_MEMORY_H
| #  include <memory.h>
| # endif
| # include <string.h>
| #endif
| #if HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #if HAVE_INTTYPES_H
| # include <inttypes.h>
| #else
| # if HAVE_STDINT_H
| #  include <stdint.h>
| # endif
| #endif
| #if HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| long longval () { return (long) (sizeof (short)); }
| unsigned long ulongval () { return (long) (sizeof (short)); }
| #include <stdio.h>
| #include <stdlib.h>
| int
| main ()
| {
|
|   FILE *f = fopen ("conftest.val", "w");
|   if (! f)
|     exit (1);
|   if (((long) (sizeof (short))) < 0)
|     {
|       long i = longval ();
|       if (i != ((long) (sizeof (short))))
|       exit (1);
|       fprintf (f, "%ld\n", i);
|     }
|   else
|     {
|       unsigned long i = ulongval ();
|       if (i != ((long) (sizeof (short))))
|       exit (1);
|       fprintf (f, "%lu\n", i);
|     }
|   exit (ferror (f) || fclose (f) != 0);
|
|   ;
|   return 0;
| }
configure:20142: error: cannot compute sizeof (short), 77
See `config.log' for more details.

Re: fail to compile with Xcode 4.2 mac os x 10.7.2

Posted: Sun Oct 16, 2011 1:45 pm
by s55
Do a completely fresh checkout.,

Re: fail to compile with Xcode 4.2 mac os x 10.7.2

Posted: Mon Oct 17, 2011 2:07 pm
by lamahk
still have same error after full checkout in new folder

gcc --version

Code: Select all

i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
svn checkout svn://svn.handbrake.fr/HandBrake/trunk HandBrake
cd HandBrake
svn info

Code: Select all

Path: .
URL: svn://svn.handbrake.fr/HandBrake/trunk
Repository Root: svn://svn.handbrake.fr/HandBrake
Repository UUID: b64f7644-9d1e-0410-96f1-a4d463321fa5
Revision: 4294
Node Kind: directory
Schedule: normal
Last Changed Author: jstebbins
Last Changed Rev: 4294
Last Changed Date: 2011-10-17 01:33:20 +0800 (Mon, 17 Oct 2011)
export PATH=<path to yasm compiled from source>:$PATH
./configure --launch

Code: Select all

: checking for u_int16_t... yes
  : checking for int64_t... yes
  : checking for short... yes
  : checking size of short... configure: error: cannot compute sizeof (short), 77
  : See `config.log' for more details.
  : make[1]: *** [contrib/libogg/.stamp.configure] Error 1
  : Showing first 200 notices only
  : Showing first 200 warnings only
  : 
  : 
  : ** BUILD FAILED **
  : 
  : 
  : The following build commands failed:
  : 	ExternalBuildToolExecution external
  : (1 failure)
  : make: *** [macosx.build] Error 65
-------------------------------------------------------------------------------
time end: Mon Oct 17 21:54:58 2011
duration: 7 minutes, 47 seconds (467.82s)
result: FAILURE (code 2)
-------------------------------------------------------------------------------
Build is finished!

Re: fail to compile with Xcode 4.2 mac os x 10.7.2

Posted: Tue Oct 18, 2011 10:37 am
by mac_man_ad
add --gcc=gcc-4.2 or something to configure (after first making sure you have it installed). XC 4.2 does not install it, and prefers llvm-gcc4.2 and clang, which it seems dependancies of Handbrake do not play nice with.

Re: fail to compile with Xcode 4.2 mac os x 10.7.2

Posted: Tue Oct 18, 2011 9:19 pm
by s55
Yeh, libogg isn't playing nice.

Working on a patch for it once I figure out how to get our build system to patch libogg properly.

Re: fail to compile with Xcode 4.2 mac os x 10.7.2

Posted: Thu Nov 17, 2011 1:11 pm
by lamahk
it now works with trunk@4353. thanks

Re: fail to compile with Xcode 4.2 mac os x 10.7.2

Posted: Sat Nov 19, 2011 4:46 am
by lamahk
It also works with Xcode 4.2.1 just release for 10.7.2

Re: fail to compile with Xcode 4.2 mac os x 10.7.2

Posted: Wed Dec 14, 2011 2:31 pm
by Apex
I did a fresh Checkout of 4375 and have the ExternalBuild failure too. I am using 10.7.2 and Xcode 4.2.1. Any hints where to look why and what is failing?

Code: Select all

/Developer/usr/bin/ranlib: file: libavformat/libavformat.a(os_support.o) has no symbols
AR	libswscale/libswscale.a
ranlib: file: libavformat/libavformat.a(os_support.o) has no symbols
AR	libavutil/libavutil.a
AR	libavcodec/libavcodec.a
touch contrib/ffmpeg/.stamp.build
Showing first 200 notices only
Showing first 200 warnings only


** BUILD FAILED **


The following build commands failed:
	ExternalBuildToolExecution external
(1 failure)
make: *** [macosx.build] Error 65

Re: fail to compile with Xcode 4.2 mac os x 10.7.2

Posted: Wed Dec 14, 2011 3:00 pm
by Deleted User 11865
Building with Xcode 4.2 under Lion is supposedly fixed after https://trac.handbrake.fr/changeset/4299

I have no issues building a fresh checkout of 4375 using:

Code: Select all

./configure --launch --enable-local-yasm

Re: fail to compile with Xcode 4.2 mac os x 10.7.2

Posted: Wed Dec 14, 2011 5:04 pm
by Apex
--enable-local-yasm did the trick, thanks

Re: fail to compile with Xcode 4.2 mac os x 10.7.2

Posted: Wed Dec 14, 2011 5:06 pm
by Deleted User 11865
So basically you were missing a dependency - yasm is required to build HandBrake (the ability to build yasm as part of the build process is a recent addition). It's listed in the build instructions on the Wiki and in the doc/ folder in the source.

Re: fail to compile with Xcode 4.2 mac os x 10.7.2

Posted: Wed Jan 04, 2012 1:59 pm
by KonaBlend
changeset https://trac.handbrake.fr/changeset/4395 automatically enables local yasm if yasm is not found in your path.

Re: fail to compile with Xcode 4.2 mac os x 10.7.2

Posted: Wed Jan 04, 2012 6:08 pm
by JohnAStebbins
:D Nice