advice on default options for building LLVM-GCC on Ubuntu Linux

it appears that by default some Apple configuration is assumed, since
a simple make complains

GNUmakefile:16: /CoreOS/Standard/Standard.make: No such file or
directory

We started with a subversion checkout, in case it matters.

Are you following the configuration/build directions in the README.LLVM? You need to follow these exactly.

Please specify your configure command and target information.

-Tanya

it appears that by default some Apple configuration is
assumed, since a simple make complains

GNUmakefile:16: /CoreOS/Standard/Standard.make: No such file
or directory

We started with a subversion checkout, in case it matters.

Never mind, we're going to start with CLANG instead. (We'll
send more questions as they come up ...)

Hi Thomas,

it appears that by default some Apple configuration is assumed, since
a simple make complains

GNUmakefile:16: /CoreOS/Standard/Standard.make: No such file or
directory

We started with a subversion checkout, in case it matters.

you need to use a separate objects directory and not build directly
in the llvm-gcc tree. For some reason the Apple people placed a file
GNUmakefile in the tree which "make" chooses in preference to the Makefile
produced by configuring. Personally I would like to see GNUmakefile
deleted. If you want to build directly in the gcc tree, try deleting
this file.

Ciao,

Duncan.

My take, you can test an environment variable called RC_RELEASE in the GNUmakefile and use it, if set, and if it isn't set, include Makefile and use it in preference. Oh course, this is untested, someone would have to test it in all three environments.

Non-apple people build from svn too, not just releases. My take is that
Apple should have their own build script which passes "make" whichever file
they want to use as the makefile, so then it doesn't need a special name
like GNUmakefile. Actually, doesn't Apple use a build script already?

Ciao,

Duncan.

We use GNUmakefile to trigger using the build_gcc script. It's not ideal, but it's all we have at the moment. For LLVM, we placed those files in a subdirectory. This isn't ideal because of our build processes, but was better than the alternative. We would *really* prefer not doing the same thing to LLVM-GCC. Because we've been building LLVM-GCC with srcdir != objdir for years now, it shouldn't be too much of a burden. . .

From what I understand, FSF GCC doesn't recommend building with srcdir == objdir. Not that this necessarily means much to us, but should indicate that it's not entirely out of the ordinary that we require srcdir != objdir for LLVM-GCC. :slight_smile:

-bw

Hi Bill,

We use GNUmakefile to trigger using the build_gcc script.

thanks for the explanation, but I still don't understand why
it is done this way. Why not just get Apple people to run some
script, rather than trying to have "make" automagically do an
Apple build?

It's not
ideal, but it's all we have at the moment. For LLVM, we placed those
files in a subdirectory. This isn't ideal because of our build
processes, but was better than the alternative. We would *really*
prefer not doing the same thing to LLVM-GCC. Because we've been
building LLVM-GCC with srcdir != objdir for years now, it shouldn't be
too much of a burden. . .

From what I understand, FSF GCC doesn't recommend building with
srcdir == objdir. Not that this necessarily means much to us, but
should indicate that it's not entirely out of the ordinary that we
require srcdir != objdir for LLVM-GCC. :slight_smile:

Newcomers to llvm-gcc regularly try to build with srcdir == objdir.
Some of them come on irc and ask about why it fails, but probably
most of them just give up on llvm-gcc.

Ciao,

Duncan.

Hi Bill,

We use GNUmakefile to trigger using the build_gcc script.

thanks for the explanation, but I still don't understand why
it is done this way. Why not just get Apple people to run some
script, rather than trying to have "make" automagically do an
Apple build?

It's more complicated than that. Suffice it to say that we wouldn't be
able to get the people who need to use GNUmakefile/build_gcc to change
just for our team (it's more than just our team that is required to do
this). In truth, they do have this. It's called "xcodebuild". But
llvm-gcc is very incompatible with this method of building.

It's not
ideal, but it's all we have at the moment. For LLVM, we placed those
files in a subdirectory. This isn't ideal because of our build
processes, but was better than the alternative. We would *really*
prefer not doing the same thing to LLVM-GCC. Because we've been
building LLVM-GCC with srcdir != objdir for years now, it shouldn't be
too much of a burden. . .

From what I understand, FSF GCC doesn't recommend building with
srcdir == objdir. Not that this necessarily means much to us, but
should indicate that it's not entirely out of the ordinary that we
require srcdir != objdir for LLVM-GCC. :slight_smile:

Newcomers to llvm-gcc regularly try to build with srcdir == objdir.
Some of them come on irc and ask about why it fails, but probably
most of them just give up on llvm-gcc.

I understand. Believe me, I'm not a big fan of this method of building
llvm-gcc either. But I'm not a Makefile guru, so I don't know how to
make the two systems of building llvm-gcc compatible. Is there a FAQ
entry on this? If not, I'll add one.

-bw

If we don't know how to fix the problem, maybe we could at least make the failures easier to understand. If someone is trying to build llvm-gcc, they will typically not run "make install" as the first step. The normal GCC makefile has a default target of "all", so a typical GCC build will invoke make with no explicit target or with a target such as "all", "bootstrap", "all-gcc", etc. We could add those targets to the GNUmakefile in a rule that prints a message about building with objdir != srcdir.

It looks to me like Apple's build system will always invoke make with an explicit target, so it would be OK to make this new rule be the default target.

From what I understand, FSF GCC doesn't recommend building with
srcdir == objdir. Not that this necessarily means much to us, but
should indicate that it's not entirely out of the ordinary that we
require srcdir != objdir for LLVM-GCC. :slight_smile:

Newcomers to llvm-gcc regularly try to build with srcdir == objdir.
Some of them come on irc and ask about why it fails, but probably
most of them just give up on llvm-gcc.

I understand. Believe me, I'm not a big fan of this method of building
llvm-gcc either. But I'm not a Makefile guru, so I don't know how to
make the two systems of building llvm-gcc compatible. Is there a FAQ
entry on this? If not, I'll add one.

This is stated in the README.LLVM and people rarely follow the directions in there too. You can't force people to read documentation.

Its worth a FAQ entry and also a FAQ entry about following the instructions in README.LLVM exactly.

-Tanya

Good point. I'll investigate to see if that works. Thanks!

-bw

From what I understand, FSF GCC doesn't recommend building with
srcdir == objdir. Not that this necessarily means much to us, but
should indicate that it's not entirely out of the ordinary that we
require srcdir != objdir for LLVM-GCC. :slight_smile:

Newcomers to llvm-gcc regularly try to build with srcdir == objdir.
Some of them come on irc and ask about why it fails, but probably
most of them just give up on llvm-gcc.

If they can't figure out how to find and read a README file, do we really want them?

I understand. Believe me, I'm not a big fan of this method of building
llvm-gcc either. But I'm not a Makefile guru, so I don't know how to
make the two systems of building llvm-gcc compatible. Is there a FAQ
entry on this? If not, I'll add one.

This is stated in the README.LLVM and people rarely follow the directions in there too. You can't force people to read documentation.

No you can't, but you need not be sympathetic when they don't.

You can't really build gcc without reading at least some of the documentation either. The problem we have is that some people come in expecting the build procedure to be identical to that of gcc, and it isn't. (Calling it llvm-gcc doesn't help, but it's too late now.)

Perhaps:

% make
A make target is required. If you think you know how to build llvm-gcc just because you know how to build gcc, you're wrong. Please read README.LLVM.

Did I mention there's a reason I don't do user interfaces? :slight_smile:

I tried it out and it seems to work. I went ahead and committed the change.