RE: [Edk2 Dev] Compiling Tools/gcc fails because of .dSYM suffix

Subject: RE: [Edk2 Dev] Compiling Tools/gcc fails because of .dSYM suffix

From: "Randy Thelen" <rthelen@vmware.com>

To: <dev@edk2.tianocore.org>, <dev@edk2.tianocore.org>

Date: 2008-05-12 08:57:32

Javen --

Thanks, this is useful information.  I was able to build the BaseTools
without any trouble.

I'd like to contribute directly to the project with modified README =
files to
clarify these issues.  What's the process for that?  I would be sad if
someone else spent time and emotion going through the same pain I'm =
going
through.

-- Randy


-----Original Message-----
From: Wang, Jian J [mailto:jian.j.wang@intel.com]
Sent: Sun 5/11/2008 9:15 PM
To: dev@edk2.tianocore.org
Subject: RE: [Edk2 Dev] Compiling Tools/gcc fails because of .dSYM =
suffix
=20
Randy,

Don't use the script in /Tools/gcc. All the things in /Tools =
are
for Ant/Java based build tools. Some of them are out-of-date. You will =
find
new script for building gcc in the source project of Python based build =
tools
in www.TianoCore.org. =20

	https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools


Cheers,
Javen

-----Original Message-----
From: Randy Thelen [mailto:rthelen@vmware.com]=20
Sent: 2008?5?10? 08:06
To: dev@edk2.tianocore.org
Subject: [Edk2 Dev] Compiling Tools/gcc fails because of .dSYM suffix

Folks --

I'm stumped.  I can't compile the Tools/gcc directory of edk2 on my =20
Mac with 10.5.  The error is deep in the bowels of the config test for =20
binutils/libtools.  The details follow.  Does anybody know what the =20
solution to this problem is?

I had been trying to build Edk2 w/ Mac OS X 10.4, but I was =20
unsuccessful at installing python 2.5 with sqlite3.3 or better (my =20
bad, undoubtedly; but I couldn't figure out why the build for python =20
crapped out).

So, I performed a fresh install of Mac OS X 10.5 on to an external =20
hard drive (so, I've got my 10.4 results lying around in a directory =20
to compare against).

After the fresh install, I installed python egg easy install and antlr =20
with easy install.  And I grabbed edk2 and BaseTools.  I build =20
BaseTools without any trouble.  I then got started with edk2 by =20
setting EDK_TOOLS_PATH=3D/Users/rthelen/Sources/BaseTools.  I ran =20
edksetup.sh, modified the Conf/target.txt, and realized I needed to =20
build my Tools/gcc.  That's where my day went to hell.

What I've found is that during the compilation of Tools/gcc I get an =20
error during the binutils configuration phase.  The error is:

$ pwd
/Users/rthelen/Sources/edk2/Tools/gcc
$ tail build-binutils-i386-tiano-pe/binutils/config.log
configure:2359: checking whether the C compiler (gcc -g -O2  ) works
configure:2375: gcc -o conftest.dSYM -g -O2    conftest.c  1>&5
ld: can't open output file for writing: conftest.dSYM
collect2: ld returned 1 exit status
configure: failed program was:

#line 2370 "configure"
#include "confdefs.h"

main(){return(0);}
$

(There's not much useful context above that point.)  So, I googled for =20
a fix and found that a guy had the same problem with Fink back in =20
January of 2008.  The response that came was:

http://www.nabble.com/Failed:-phase-compiling:-oleo-1.99.16-1021-failed-o=
n-Le
opard-td14876386.html

> It's the nonsensical "-o conftest.dSYM" that
> makes this crash. I checked a fix into CVS, plus another fix for a =20
> crash
> that happens later on. See if this works for you.

OK, so I checked my old version:


$ less /Volumes/Macintosh\ HD/Users/rthelen/Sources/edk2/Tools/gcc/=20
build-binutils-i386-tiano-pe/binutils/config.log
[...]
configure:2359: checking whether the C compiler (gcc -g -O2  ) works
configure:2375: gcc -o conftest -g -O2    conftest.c  1>&5
configure:2401: checking whether the C compiler (gcc -g -O2  ) is a =20
cross-compiler
configure:2406: checking whether we are using GNU C
configure:2434: checking whether gcc accepts -g
configure:2471: checking for bison
configure:2502: checking how to run the C preprocessor
[...]
$

No errors were reported during the conf phase.  (In fact, in the 10.4 =20
system, I was able to complete the build of the tianoCross compilers =20
and tools.)

So now let's see if there is a reference to .dSYM somewhere within my =20
tree that I can simply fix.  What I did was to grab another edk2 tree =20
(actually, from a tar image that's about a week out of date), modify =20
the tianoCross-gcc-4.1 script so that it would getSource, =20
unpackSource, but not build.  Then I ran the script and performed a =20
find:

$ find . | xargs fgrep dSYM

Nothing.  There is no reference to dSYM in this directory (before the =20
build phase, which includes the configure phase) at all.  None.  So =20
where does the dSYM reference come from?

Well, libtool has a reference to it -after- a failed build:

$ pwd
/Users/rthelen/Sources/edk2/Tools/gcc/build-binutils-i386-tiano-pe/=20
binutils
$ grep dSYM libtool
exeext=3D".dSYM"
$

And that's in the same directory as the config.log that choked:

$ grep dSYM *
config.cache:ac_cv_exeext=3D${ac_cv_exeext=3D.dSYM}
config.log:configure:2375: gcc -o conftest.dSYM -g -O2    conftest.c  =20
1>&5
config.log:ld: can't open output file for writing: conftest.dSYM
libtool:exeext=3D".dSYM"
$

Alright, where did libtool come from:

$ head libtool
#! /bin/sh

# libtool - Provide generalized library-building support services.
# Generated automatically by ltconfig (GNU libtool 1.4a-GCC3.0 =20
(1.641.2.256 2001/05/28 20:09:07 with GCC-local changes))
# NOTE: Changes made to this file will be lost: look at ltconfig or =20
ltmain.sh.

OK, so I decided that ltconfig comes from gcc, so I modifed the gcc =20
that I was downloading for tianoCross to 4.1.2, but that didn't fix =20
anything:

$ ./tianoCross-4.1
[...]
$ cd build-binutils-i386-tiano-pe/binutils/
$ tail config.log
configure:2359: checking whether the C compiler (gcc -g -O2  ) works
configure:2375: gcc -o conftest.dSYM -g -O2    conftest.c  1>&5
ld: can't open output file for writing: conftest.dSYM
collect2: ld returned 1 exit status
configure: failed program was:

#line 2370 "configure"
#include "confdefs.h"

main(){return(0);}
$

I checked out the most recent version of edk2, at change level 5193 =20
and I got the same result:

$ tail build-binutils-i386-tiano-pe/binutils/config.log
configure:2359: checking whether the C compiler (gcc -g -O2  ) works
configure:2375: gcc -o conftest.dSYM -g -O2    conftest.c  1>&5
ld: can't open output file for writing: conftest.dSYM
collect2: ld returned 1 exit status
configure: failed program was:

#line 2370 "configure"
#include "confdefs.h"

main(){return(0);}
$

Aarrrggghhh!!

Does anybody know what the source of this problem is and how to fix it?

-- Randy


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@edk2.tianocore.org
For additional commands, e-mail: dev-help@edk2.tianocore.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@edk2.tianocore.org
For additional commands, e-mail: dev-help@edk2.tianocore.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@edk2.tianocore.org
For additional commands, e-mail: dev-help@edk2.tianocore.org