Makefile dependencies and configure test fix

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Makefile dependencies and configure test fix

Shantonu Sen
Some low-priority fixes to the build system.... These can probably wait after 2.2

1) The current configure script checks for gcc 3.x or later by parsing "gcc --version" output and trying to tokenize it to find the major compiler version. This is pretty fragile and interacts poorly with compilers produced by vendors (like Apple) that modify this string to output target triple (including potentially i686 and darwin9), FSF GCC version, Apple local version. There's lots of numbers there, and the sed expression doesn't find any of the right ones. This patch turns the check into a compile-time check for __GNUC__ version. Since autoconf already does this to determine if you're using GCC or not, it should be pretty safe.

Believe it or not, I dusted off a copy of gcc 2.95.2 for Mac OS X for PowerPC and ran it under Rosetta to verify this fix:

[ssen@virgon]$ gcc-2.95.2 -v
Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
Apple Computer, Inc. version gcc-926, based on gcc version 2.95.2 19991024 (release)
[ssen@virgon]$ ./configure CC=gcc-2.95.2 CXX=g++-2.95.2
...
checking for llvm-gcc... no
checking for llvm-g++... no
checking tool compatibility... configure: error: gcc 3.x required, but you have a lower version

2) Makefile.rules is missing some dependencies for shared library targets, which means if you change core libraries and do a rebuild, things like tools/lto don't get relinked against the new libraries. Test case is to have a pre-built tree and do "touch lib/System/Unix/Program.inc && make" and make sure you see "Linking Debug Loadable Module LLVMlto.dylib".

3) There appears to be a typo for for llvm_cv_no_link_all_option for Darwin, but this never seems to be used anyway. Probably worth fixing in case a new standalone project uses the LLVM makefiles.

I regenerated the configure script with the required versions of autotools on Mac OS X on Intel.



Shantonu Sen

Sent from my Mac Pro


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

llvm-makefile-and-configure.patch (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Makefile dependencies and configure test fix

Tanya Lattner
Shantonu,

I just wanted to verify that you used the llvm/autoconf/AutoRegen.sh script to regenerate configure. Is that correct?

Thanks,
Tanya

On Feb 5, 2008, at 10:10 AM, Shantonu Sen wrote:

Some low-priority fixes to the build system.... These can probably wait after 2.2

1) The current configure script checks for gcc 3.x or later by parsing "gcc --version" output and trying to tokenize it to find the major compiler version. This is pretty fragile and interacts poorly with compilers produced by vendors (like Apple) that modify this string to output target triple (including potentially i686 and darwin9), FSF GCC version, Apple local version. There's lots of numbers there, and the sed expression doesn't find any of the right ones. This patch turns the check into a compile-time check for __GNUC__ version. Since autoconf already does this to determine if you're using GCC or not, it should be pretty safe.

Believe it or not, I dusted off a copy of gcc 2.95.2 for Mac OS X for PowerPC and ran it under Rosetta to verify this fix:

[ssen@virgon]$ gcc-2.95.2 -v
Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
Apple Computer, Inc. version gcc-926, based on gcc version 2.95.2 19991024 (release)
[ssen@virgon]$ ./configure CC=gcc-2.95.2 CXX=g++-2.95.2
...
checking for llvm-gcc... no
checking for llvm-g++... no
checking tool compatibility... configure: error: gcc 3.x required, but you have a lower version

2) Makefile.rules is missing some dependencies for shared library targets, which means if you change core libraries and do a rebuild, things like tools/lto don't get relinked against the new libraries. Test case is to have a pre-built tree and do "touch lib/System/Unix/Program.inc && make" and make sure you see "Linking Debug Loadable Module LLVMlto.dylib".

3) There appears to be a typo for for llvm_cv_no_link_all_option for Darwin, but this never seems to be used anyway. Probably worth fixing in case a new standalone project uses the LLVM makefiles.

I regenerated the configure script with the required versions of autotools on Mac OS X on Intel.

<llvm-makefile-and-configure.patch>

Shantonu Sen

Sent from my Mac Pro

_______________________________________________
LLVM Developers mailing list


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Makefile dependencies and configure test fix

Shantonu Sen
Yes, I did, the the required versions of autoconf, automake, and libtool in a directory at the front of my PATH.

Shantonu Sen

Sent from my Mac Pro

On Feb 5, 2008, at 10:34 AM, Tanya Lattner wrote:

Shantonu,

I just wanted to verify that you used the llvm/autoconf/AutoRegen.sh script to regenerate configure. Is that correct?

Thanks,
Tanya

On Feb 5, 2008, at 10:10 AM, Shantonu Sen wrote:

Some low-priority fixes to the build system.... These can probably wait after 2.2

1) The current configure script checks for gcc 3.x or later by parsing "gcc --version" output and trying to tokenize it to find the major compiler version. This is pretty fragile and interacts poorly with compilers produced by vendors (like Apple) that modify this string to output target triple (including potentially i686 and darwin9), FSF GCC version, Apple local version. There's lots of numbers there, and the sed expression doesn't find any of the right ones. This patch turns the check into a compile-time check for __GNUC__ version. Since autoconf already does this to determine if you're using GCC or not, it should be pretty safe.

Believe it or not, I dusted off a copy of gcc 2.95.2 for Mac OS X for PowerPC and ran it under Rosetta to verify this fix:

[ssen@virgon]$ gcc-2.95.2 -v
Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
Apple Computer, Inc. version gcc-926, based on gcc version 2.95.2 19991024 (release)
[ssen@virgon]$ ./configure CC=gcc-2.95.2 CXX=g++-2.95.2
...
checking for llvm-gcc... no
checking for llvm-g++... no
checking tool compatibility... configure: error: gcc 3.x required, but you have a lower version

2) Makefile.rules is missing some dependencies for shared library targets, which means if you change core libraries and do a rebuild, things like tools/lto don't get relinked against the new libraries. Test case is to have a pre-built tree and do "touch lib/System/Unix/Program.inc && make" and make sure you see "Linking Debug Loadable Module LLVMlto.dylib".

3) There appears to be a typo for for llvm_cv_no_link_all_option for Darwin, but this never seems to be used anyway. Probably worth fixing in case a new standalone project uses the LLVM makefiles.

I regenerated the configure script with the required versions of autotools on Mac OS X on Intel.

<llvm-makefile-and-configure.patch>

Shantonu Sen

Sent from my Mac Pro

_______________________________________________
LLVM Developers mailing list

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Makefile dependencies and configure test fix

Chris Lattner
In reply to this post by Shantonu Sen
On Tue, 5 Feb 2008, Shantonu Sen wrote:
> Some low-priority fixes to the build system.... These can probably wait after
> 2.2

Very nice Shantonu, applied:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20080204/057939.html
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20080204/057940.html

Thanks!

-Chris

> 1) The current configure script checks for gcc 3.x or later by parsing "gcc
> --version" output and trying to tokenize it to find the major compiler
> version. This is pretty fragile and interacts poorly with compilers produced
> by vendors (like Apple) that modify this string to output target triple
> (including potentially i686 and darwin9), FSF GCC version, Apple local
> version. There's lots of numbers there, and the sed expression doesn't find
> any of the right ones. This patch turns the check into a compile-time check
> for __GNUC__ version. Since autoconf already does this to determine if you're
> using GCC or not, it should be pretty safe.
>
> Believe it or not, I dusted off a copy of gcc 2.95.2 for Mac OS X for PowerPC
> and ran it under Rosetta to verify this fix:
>
> [ssen@virgon]$ gcc-2.95.2 -v
> Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
> Apple Computer, Inc. version gcc-926, based on gcc version 2.95.2 19991024
> (release)
> [ssen@virgon]$ ./configure CC=gcc-2.95.2 CXX=g++-2.95.2
> ...
> checking for llvm-gcc... no
> checking for llvm-g++... no
> checking tool compatibility... configure: error: gcc 3.x required, but you
> have a lower version
>
> 2) Makefile.rules is missing some dependencies for shared library targets,
> which means if you change core libraries and do a rebuild, things like
> tools/lto don't get relinked against the new libraries. Test case is to have
> a pre-built tree and do "touch lib/System/Unix/Program.inc && make" and make
> sure you see "Linking Debug Loadable Module LLVMlto.dylib".
>
> 3) There appears to be a typo for for llvm_cv_no_link_all_option for Darwin,
> but this never seems to be used anyway. Probably worth fixing in case a new
> standalone project uses the LLVM makefiles.
>
> I regenerated the configure script with the required versions of autotools on
> Mac OS X on Intel.
>
>
> Shantonu Sen
> [hidden email]
>
> Sent from my Mac Pro
>
>
>

-Chris

--
http://nondot.org/sabre/
http://llvm.org/
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev