Discussion:
Announcing `autocrossgen'
Bryan Hundven
2014-10-23 02:58:19 UTC
Permalink
Hello list,

Out of necessity for a tool to build a cross-compiler that is more
friendly to developers, I started this project. I've posted it to
github so that it is easy for others to contribute to:

https://github.com/bhundven/autocrossgen

If you'd like to contribute, check out the issues and milestones:
https://github.com/bhundven/autocrossgen/issues
https://github.com/bhundven/autocrossgen/milestones

Just fork the code, make changes to your tree, and open a pull request.

Enjoy!

-Bryan

--
For unsubscribe information see http://sourceware.org/lists.html#faq
Per Arnold Blaasmo
2014-10-23 07:35:58 UTC
Permalink
Post by Bryan Hundven
Hello list,
Out of necessity for a tool to build a cross-compiler that is more
friendly to developers, I started this project. I've posted it to
https://github.com/bhundven/autocrossgen
https://github.com/bhundven/autocrossgen/issues
https://github.com/bhundven/autocrossgen/milestones
Just fork the code, make changes to your tree, and open a pull request.
Enjoy!
-Bryan
--
For unsubscribe information see http://sourceware.org/lists.html#faq
Hi Bryan,

"more friendly" is not a very concrete term, can you be more specific
and maybe make a comparison with i.e. crosstool-ng.

I appreciate the initiative, but what to know more :-)

Regards
Per A.


--
For unsubscribe information see http://sourceware.org/lists.html#faq
Bryan Hundven
2014-10-23 07:41:31 UTC
Permalink
Per, List,

To get context correct "more friendly to developers". So say you are
working on binutils, gcc, glibc, musl-libc, etc...

If you are using crosstool-ng, you have to save steps if you want to
not build the prereqs for building gcc (say you are working on gcc
specifically) over and over again. autocrossgen's build system uses
GNU/Make rather then Bash. So you can just delete the build/gcc*, type
make and the build will leave off at configuring and building gcc
instead of starting the whole build process over from scratch.

-Bryan

On Thu, Oct 23, 2014 at 12:35 AM, Per Arnold Blaasmo
Post by Per Arnold Blaasmo
Post by Bryan Hundven
Hello list,
Out of necessity for a tool to build a cross-compiler that is more
friendly to developers, I started this project. I've posted it to
https://github.com/bhundven/autocrossgen
https://github.com/bhundven/autocrossgen/issues
https://github.com/bhundven/autocrossgen/milestones
Just fork the code, make changes to your tree, and open a pull request.
Enjoy!
-Bryan
--
For unsubscribe information see http://sourceware.org/lists.html#faq
Hi Bryan,
"more friendly" is not a very concrete term, can you be more specific
and maybe make a comparison with i.e. crosstool-ng.
I appreciate the initiative, but what to know more :-)
Regards
Per A.
--
For unsubscribe information see http://sourceware.org/lists.html#faq
--
For unsubscribe information see http://sourceware.org/lists.html#faq
Bryan Hundven
2014-10-23 07:58:37 UTC
Permalink
Per, List,
Post by Bryan Hundven
Per, List,
To get context correct "more friendly to developers". So say you are
working on binutils, gcc, glibc, musl-libc, etc...
If you are using crosstool-ng, you have to save steps if you want to
not build the prereqs for building gcc (say you are working on gcc
specifically) over and over again. autocrossgen's build system uses
GNU/Make rather then Bash. So you can just delete the build/gcc*, type
make and the build will leave off at configuring and building gcc
instead of starting the whole build process over from scratch.
-Bryan
Whoops, I totally top-posted there. Sorry about that!

I might also mention that the project is in an early stage. I just got
the first toolchain to build from it tonight
(arm-unknown-linux-gnueabi) and built kernel 3.18-rc1 with it.
Post by Bryan Hundven
From a normal user's perspective, it is much more of an advanced tool.
I find that if you are looking for a simple tool to build
cross-compilers that supports a lot of different features, stick with
crosstool-ng.

It may be a while until autocrossgen gets features that ct-ng has.
ACG will not have support for kconfig, instead it will just use
autoconf's 'configure' script to provide an interface for setting
options (most of which still needs to be implemented).

Plenty of work to be done, and definitely not a drop-in replacement
for crosstool-ng.

So, simpler for developers, nightmare for normal users ;)

-Bryan
Post by Bryan Hundven
On Thu, Oct 23, 2014 at 12:35 AM, Per Arnold Blaasmo
Post by Per Arnold Blaasmo
Post by Bryan Hundven
Hello list,
Out of necessity for a tool to build a cross-compiler that is more
friendly to developers, I started this project. I've posted it to
https://github.com/bhundven/autocrossgen
https://github.com/bhundven/autocrossgen/issues
https://github.com/bhundven/autocrossgen/milestones
Just fork the code, make changes to your tree, and open a pull request.
Enjoy!
-Bryan
--
For unsubscribe information see http://sourceware.org/lists.html#faq
Hi Bryan,
"more friendly" is not a very concrete term, can you be more specific
and maybe make a comparison with i.e. crosstool-ng.
I appreciate the initiative, but what to know more :-)
Regards
Per A.
--
For unsubscribe information see http://sourceware.org/lists.html#faq
--
For unsubscribe information see http://sourceware.org/lists.html#faq
Nikita Orlov
2014-10-23 08:18:06 UTC
Permalink
Hi!

Is it possible to build toolchain for arm, that runs on same arm, but build toolchain on x86?
Post by Bryan Hundven
Per, List,
To get context correct "more friendly to developers". So say you are
working on binutils, gcc, glibc, musl-libc, etc...
If you are using crosstool-ng, you have to save steps if you want to
not build the prereqs for building gcc (say you are working on gcc
specifically) over and over again. autocrossgen's build system uses
GNU/Make rather then Bash. So you can just delete the build/gcc*, type
make and the build will leave off at configuring and building gcc
instead of starting the whole build process over from scratch.
-Bryan
On Thu, Oct 23, 2014 at 12:35 AM, Per Arnold Blaasmo
 Hello list,
 Out of necessity for a tool to build a cross-compiler that is more
 friendly to developers, I started this project. I've posted it to
 https://github.com/bhundven/autocrossgen
 https://github.com/bhundven/autocrossgen/issues
 https://github.com/bhundven/autocrossgen/milestones
 Just fork the code, make changes to your tree, and open a pull request.
 Enjoy!
 -Bryan
 --
 For unsubscribe information see http://sourceware.org/lists.html#faq
 Hi Bryan,
 "more friendly" is not a very concrete term, can you be more specific
 and maybe make a comparison with i.e. crosstool-ng.
 I appreciate the initiative, but what to know more :-)
 Regards
 Per A.
 --
 For unsubscribe information see http://sourceware.org/lists.html#faq
--
For unsubscribe information see http://sourceware.org/lists.html#faq
-- 
Nikita Orlov
Skype: nik_stet
QQ: 2717846083

--
For unsubscribe information see http://sourceware.org/lists.html#faq
Bryan Hundven
2014-10-23 08:27:25 UTC
Permalink
Nikita, list,
Post by Nikita Orlov
Hi!
Is it possible to build toolchain for arm, that runs on same arm, but build toolchain on x86?
Currently autocrossgen only builds cross-compilers. It doesn't
currently support native compilers. I am not sure that I will ever
support native compilers, hence the 'cross' in the name of the
project.

-Bryan

P.S. try not to top-post
Post by Nikita Orlov
Post by Bryan Hundven
Per, List,
To get context correct "more friendly to developers". So say you are
working on binutils, gcc, glibc, musl-libc, etc...
If you are using crosstool-ng, you have to save steps if you want to
not build the prereqs for building gcc (say you are working on gcc
specifically) over and over again. autocrossgen's build system uses
GNU/Make rather then Bash. So you can just delete the build/gcc*, type
make and the build will leave off at configuring and building gcc
instead of starting the whole build process over from scratch.
-Bryan
On Thu, Oct 23, 2014 at 12:35 AM, Per Arnold Blaasmo
Post by Per Arnold Blaasmo
Post by Bryan Hundven
Hello list,
Out of necessity for a tool to build a cross-compiler that is more
friendly to developers, I started this project. I've posted it to
https://github.com/bhundven/autocrossgen
https://github.com/bhundven/autocrossgen/issues
https://github.com/bhundven/autocrossgen/milestones
Just fork the code, make changes to your tree, and open a pull request.
Enjoy!
-Bryan
--
For unsubscribe information see http://sourceware.org/lists.html#faq
Hi Bryan,
"more friendly" is not a very concrete term, can you be more specific
and maybe make a comparison with i.e. crosstool-ng.
I appreciate the initiative, but what to know more :-)
Regards
Per A.
--
For unsubscribe information see http://sourceware.org/lists.html#faq
--
For unsubscribe information see http://sourceware.org/lists.html#faq
--
Nikita Orlov
Skype: nik_stet
QQ: 2717846083
--
For unsubscribe information see http://sourceware.org/lists.html#faq
Nikita Orlov
2014-10-23 09:06:56 UTC
Permalink
I see. Thanks! Maybe you can advice me some tool for such task?
Post by Bryan Hundven
Nikita, list,
 Hi!
 Is it possible to build toolchain for arm, that runs on same arm, but build toolchain on x86?
Currently autocrossgen only builds cross-compilers. It doesn't
currently support native compilers. I am not sure that I will ever
support native compilers, hence the 'cross' in the name of the
project.
-Bryan
P.S. try not to top-post
 Per, List,
 To get context correct "more friendly to developers". So say you are
 working on binutils, gcc, glibc, musl-libc, etc...
 If you are using crosstool-ng, you have to save steps if you want to
 not build the prereqs for building gcc (say you are working on gcc
 specifically) over and over again. autocrossgen's build system uses
 GNU/Make rather then Bash. So you can just delete the build/gcc*, type
 make and the build will leave off at configuring and building gcc
 instead of starting the whole build process over from scratch.
 -Bryan
 On Thu, Oct 23, 2014 at 12:35 AM, Per Arnold Blaasmo
  Hello list,
  Out of necessity for a tool to build a cross-compiler that is more
  friendly to developers, I started this project. I've posted it to
  https://github.com/bhundven/autocrossgen
  https://github.com/bhundven/autocrossgen/issues
  https://github.com/bhundven/autocrossgen/milestones
  Just fork the code, make changes to your tree, and open a pull request.
  Enjoy!
  -Bryan
  --
  For unsubscribe information see http://sourceware.org/lists.html#faq
  Hi Bryan,
  "more friendly" is not a very concrete term, can you be more specific
  and maybe make a comparison with i.e. crosstool-ng.
  I appreciate the initiative, but what to know more :-)
  Regards
  Per A.
  --
  For unsubscribe information see http://sourceware.org/lists.html#faq
 --
 For unsubscribe information see http://sourceware.org/lists.html#faq
 --
 Nikita Orlov
 Skype: nik_stet
 QQ: 2717846083
--
For unsubscribe information see http://sourceware.org/lists.html#faq
-- 
Nikita Orlov
Skype: nik_stet
QQ: 2717846083

--
For unsubscribe information see http://sourceware.org/lists.html#faq
ANDY KENNEDY
2014-10-23 17:28:08 UTC
Permalink
-----Original Message-----
Sent: Thursday, October 23, 2014 4:07 AM
To: Bryan Hundven
Subject: Re: Announcing `autocrossgen'
I see. Thanks! Maybe you can advice me some tool for such task?
Nikita,

Assuming your question was:

Can you give me advice on a tool that would build me a native toolchain
for Arm?

The answer to this would be: Currently, there is nothing that will do
this for you. Older versions of BuildRoot (pre 2013) would build you a
toolchain for the target, but this support has been removed. Having
said this, you can build gcc against your cross-toolchain and make it
work the right way for the target. At that point, it would be a great
idea for you to natively build (assuming the cross-built gcc you have
works) gcc again for the target (this will ensure that gcc has the
correct paths associated with it - which can be a problem when building
some things).

If your target is supported in BuildRoot-2012.02, then you should be
able to select legacy options and choose to build each component of a
toolchain through the menu options.

Good luck!

Andy

--
For unsubscribe information see http://sourceware.org/lists.html#faq
Bryan Hundven
2014-10-23 09:18:20 UTC
Permalink
Post by Nikita Orlov
Hi!
Is it possible to build toolchain for arm, that runs on same arm, but build toolchain on x86?
Maybe I was confused. You're building the toolchain on x86, but it
will run on arm and target arm.

I still don't think the autocrossgen is for you. Might want to ask on
the gcc-help mailing list.

-Bryan
Post by Nikita Orlov
Post by Bryan Hundven
Per, List,
To get context correct "more friendly to developers". So say you are
working on binutils, gcc, glibc, musl-libc, etc...
If you are using crosstool-ng, you have to save steps if you want to
not build the prereqs for building gcc (say you are working on gcc
specifically) over and over again. autocrossgen's build system uses
GNU/Make rather then Bash. So you can just delete the build/gcc*, type
make and the build will leave off at configuring and building gcc
instead of starting the whole build process over from scratch.
-Bryan
On Thu, Oct 23, 2014 at 12:35 AM, Per Arnold Blaasmo
Post by Per Arnold Blaasmo
Post by Bryan Hundven
Hello list,
Out of necessity for a tool to build a cross-compiler that is more
friendly to developers, I started this project. I've posted it to
https://github.com/bhundven/autocrossgen
https://github.com/bhundven/autocrossgen/issues
https://github.com/bhundven/autocrossgen/milestones
Just fork the code, make changes to your tree, and open a pull request.
Enjoy!
-Bryan
--
For unsubscribe information see http://sourceware.org/lists.html#faq
Hi Bryan,
"more friendly" is not a very concrete term, can you be more specific
and maybe make a comparison with i.e. crosstool-ng.
I appreciate the initiative, but what to know more :-)
Regards
Per A.
--
For unsubscribe information see http://sourceware.org/lists.html#faq
--
For unsubscribe information see http://sourceware.org/lists.html#faq
--
Nikita Orlov
Skype: nik_stet
QQ: 2717846083
--
For unsubscribe information see http://sourceware.org/lists.html#faq
Thomas Petazzoni
2014-10-23 18:49:02 UTC
Permalink
Dear Bryan Hundven,
Post by Bryan Hundven
If you are using crosstool-ng, you have to save steps if you want to
not build the prereqs for building gcc (say you are working on gcc
specifically) over and over again. autocrossgen's build system uses
GNU/Make rather then Bash. So you can just delete the build/gcc*, type
make and the build will leave off at configuring and building gcc
instead of starting the whole build process over from scratch.
If all what you want is to be able to restart the build of the
toolchain like you say, why not give a try to Buildroot
(http://buildroot.org) ? It's written entirely in make, and works
exactly like you say: if you want to restart the build only of one
specific component, you just do:

make gcc-rebuild

See also
http://buildroot.org/downloads/manual/manual.html#_advanced_usage and
specifically the part "8.11.6. Using Buildroot during development".

Buildroot already supports uClibc, (e)glibc and musl, for a wide range
of architectures.

Best regards,

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

--
For unsubscribe information see http://sourceware.org/lists.html#faq
Bryan Hundven
2014-10-23 19:50:06 UTC
Permalink
Thomas,

On Thu, Oct 23, 2014 at 11:49 AM, Thomas Petazzoni
Post by Thomas Petazzoni
Dear Bryan Hundven,
Post by Bryan Hundven
If you are using crosstool-ng, you have to save steps if you want to
not build the prereqs for building gcc (say you are working on gcc
specifically) over and over again. autocrossgen's build system uses
GNU/Make rather then Bash. So you can just delete the build/gcc*, type
make and the build will leave off at configuring and building gcc
instead of starting the whole build process over from scratch.
If all what you want is to be able to restart the build of the
toolchain like you say, why not give a try to Buildroot
(http://buildroot.org) ? It's written entirely in make, and works
exactly like you say: if you want to restart the build only of one
make gcc-rebuild
See also
http://buildroot.org/downloads/manual/manual.html#_advanced_usage and
specifically the part "8.11.6. Using Buildroot during development".
Buildroot already supports uClibc, (e)glibc and musl, for a wide range
of architectures.
Best regards,
Thomas
I can agree that buildroot is one possibility.
Trust that I have evaluated a lot of different systems before coming
to the conclusion of starting autocrossgen. Lets quickly go through
some of those evaluations and why I chose not to use `X':

## crosstool-ng
With the elephant in the room, lets just get this one out of the way quickly.
* It is slowly updated, and quickly out of date.
* Trying to bend it to use daily/weekly snapshots of binutils (needed
for building gcc from snapshots or subversion) is not supported
upstream.
* To the same point, getting it to build gcc snapshots/subversion is
somewhat painful, since these types of changes are not allowed in
upstream crosstool-ng.
* The previous two features not being supported upstream means I have
to have my own fork of ct-ng, which I don't want to do because I
sometimes dislike working on the code-base itself. I usually make
commits to crosstool-ng because no other tool has as much support and
focus on just making a toolchain.
* Rebuilding from specific points in the build is painful.

My points on crosstool-ng are specific to my use-case of what I need
for a specific set of projects I am interested in. If you are building
a stable toolchain that you want to be able to reproduce over the
lifetime of an embedded project, crosstool-ng is the tool you want!

## cgen
This tool is fairly old, and I've spoke with Frank Ch. Eigler about me
possibly sending him changes to update this tool, it's code-base is
pretty complicated and out of date (uses scheme?!).

## musl-cross
I probably don't need to go into as many points with this one, it only
supports musl-libc. It is a very simple code-base though. And useful
if all you need to do is test musl-libc.

## buildroot
All I need to do is build a toolchain, a quick build of the linux
kernel for the architecture at hand and maybe u-boot if needed, run it
under qemu to make sure things "build and run". Buildroot does this
and much more, so much more that using it for my small use-case feels
to me like swatting a fly with a sledge hammer. I didn't look into
using buildroot to build snapshot/git versions of binutils or
snapshots/subversion versions of gcc, but that is a need for my
use-case.

I'm *NOT* saying that "I think buildroot is useless". Because that
would be bad judgement of where I'm coming from. I use buildroot for
many of my embedded projects. I like it much for what it does, but it
doesn't help me to make changes to gcc and others, quickly spin just a
toolchain build, and run a few tests.

## ptxdist, yocto, gentoo, et-alii
These are about the same as buildroot for me. too much infrastructure
around building a target image, and these tools do a lot more then
buildroot, such as creating 'sdk' tarballs for application developers,
and developer tools for the target.

***

The open-source landscape has a lot of options, and last but not least
is running the build by hand... which I'm sure we have all either done
on our own, or guided by linux-from-scratch (or cross-lfs).

Most gcc developers use the combined method, where you just extract
gcc to a source directory: 'combined'
then extract binutils in the same 'combined' directory (overwriting
any pre-existing files).
gmp, mpfr, mpc, isl, cloog, and libelf get copied (as those names) to
the root directory of the combined folder.
Then you create and change to a build folder and then you configure
(running configure from the combined folder from the build directory)
and build a bootstrap. The process is documented very well here
(although a bit out of date, it still uses cvs):
https://gcc.gnu.org/wiki/Building_Cross_Toolchains_with_gcc
https://gcc.gnu.org/install/

***

## Autocrossgen builds:
- Binutils for the host (with gmp, mpfr, mpc, isl, cloog, and libelf combined)
- Gcc pass1 to build the libc (with the same libraries in the combined build)
- Libc of choice (discovered by reading the last quad of the tuple,
*-*-linux-gnu* for glibc, *-*-linux-uclibc* for uclibc, and
*-*-linux-musl* for musl-libc)
- Gcc final (with combined libraries)
- Binutils for the target (also with combined libraries)

The combined libraries are simpler to manage then writing a bunch of
build architecture to support building each library separately and
making sure that the major component being built (gcc or binutils) are
finding the right version, and possibly not the host version. It's a
matter of consistency.

You can clone autocrossgen right now and create either a arm or
powerpc toolchain like so:

```
git clone https://github.com/bhundven/autocrossgen
cd autocrossgen
./autogen.sh
./configure --prefix=arm-acg-toolchain --target=arm-unknown-linux-gnueabi
make all
```

or for powerpc (32):
```
git clone https://github.com/bhundven/autocrossgen
cd autocrossgen
./autogen.sh
./configure --prefix=powerpc-acg-toolchain --target=powerpc-unknown-linux-gnu
make all
```

to evaluate what I've done for yourself. I've mentioned before that it
is at a very early stage. There are missing checks, issues with
parallel builds, lack of support for specific architectures, which I
hope most of this is resolved in some time.

I hope this is a better explanation of autocrossgen. It doesn't
replace any existing project, it just fits a small niche I have to
"itch" :)

-Bryan

--
For unsubscribe information see http://sourceware.org/lists.html#faq
Loading...