Discussion:
Cross compilation issue
$rik@nth
2016-03-29 15:03:22 UTC
Permalink
Hi All,

I don't whether this is the right community mailing list to post
support or not. Please correct me if i am wrong.

I am trying to cross compile gcc to ARM as static binaries and as part
of this, i am facing below issue. My build system is Ubuntu and using
[1] gcc branch. Let me know what i can share more information to you.

arm-linux-gnueabi-g++ -static -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE
-fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall
-Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute
-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings
-DHAVE_CONFIG_H -static-libstdc++ -static-libgcc -static -pthread -o
xgcc gcc.o ggc-none.o \
c/gccspec.o libcommon-target.a \
libcommon.a ../libcpp/libcpp.a
../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a
../libdecnumber/libdecnumber.a
gcc.o:(.rodata+0x5acc): undefined reference to
`host_detect_local_cpu(int, char const**)'
collect2: error: ld returned 1 exit status
make[2]: *** [xgcc] Error 1

[1] svn://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_8-branch
--
Thanks & Regards,
M.Srikanth Kumar.
Jim Wilson
2016-03-29 16:00:00 UTC
Permalink
Post by $***@nth
gcc.o:(.rodata+0x5acc): undefined reference to
`host_detect_local_cpu(int, char const**)'
This suggests a problem with the --host configure option.
host_detect_local_cpu is used only if __arm__ is defined, which means
you must be using an arm compiler to build gcc. host_detect_local_cpu
comes from the driver-arm.c file, which is only added if the host is
arm*-*-freebsd* or arm*-*-linux*, and the target is arm*-*-*. So it
appears that the --host configure option is wrong.

Sounds like you are trying to use an x86->arm cross compiler to build
a native arm gcc. In this case, the configure command needs to have
--build=x86_64-pc-inux-gnu --host=arm-linux-gnueabi
--target=arm-linux-gnueabi for this to work. Assuming you are
building on a 64-bit x86 linux pc of course.

Jim
$rik@nth
2016-03-30 06:12:31 UTC
Permalink
Post by Jim Wilson
--build=x86_64-pc-inux-gnu --host=arm-linux-gnueabi
Yes. I am using ubuntu 64bit to cross compile GCC to ARM. If i issue
--host=arm-linux-gnueabi then it will pick up default
/usr/arm-linux-gnuebi bins. I would like to pick up my binutils which
are built statically for doing some experiment.

My configure looks like this
PATH=$TOOLS_PATH/bin:$PATH ../configure --prefix=$TOOLS_PATH
--with-gmp=/local2/mnt/tools/Linux-kernel/gmp-4.3.2/bins_2262016/
--with-mpfr=/local2/mnt/tools/Linux-kernel/mpfr-3.1.3/bins_2262016/
--with-mpc=/local2/mnt/tools/Linux-kernel/mpc-1.0.3/bins_2262016
--enable-languages=c --without-headers --target=$TRIPLET
--disable-libmudflap -disable-libatomic --disable-threads
--disable-shared --enable-static --disable-decimal-float
--disable-libgomp --disable-libitm --disable-libmudflap
--disable-libquadmath --disable-libsanitizer --disable-libssp
--host=arm-linux-gnueabi --target=arm-linux-gnueabi
AR=arm-linux-gnueabi-ar CC=arm-linux-gnueabi-gcc
RANLIB=arm-linux-gnueabi-gcc-ranlib-4.7 STRIP=arm-linux-gnueabi-strip
CPP=arm-linux-gnueabi-g++ CXX=arm-linux-gnueabi-g++ CFLAGS="-static"
CXXFLAGS="-static" LDFLAGS="-static -pthread"

Now i am hitting one more issue before earlier one comes.

configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[1]: *** [configure-build-libiberty] Error 1

Seems am i not providing correct configure or my environment is messed?
--
Thanks & Regards,
M.Srikanth Kumar.
Jim Wilson
2016-03-30 15:42:56 UTC
Permalink
Post by $***@nth
Yes. I am using ubuntu 64bit to cross compile GCC to ARM. If i issue
--host=arm-linux-gnueabi then it will pick up default
/usr/arm-linux-gnuebi bins. I would like to pick up my binutils which
are built statically for doing some experiment.
If binutils was built and installed with the same prefix as gcc, then
gcc should automatically find and use it.

For cross building a native, you need to build a cross compiler first,
and then put it on your path, in which case the cross built native
should use your cross compiler.
Post by $***@nth
--host=arm-linux-gnueabi --target=arm-linux-gnueabi
You have host and target, but not build. You should specify all three.
Post by $***@nth
AR=arm-linux-gnueabi-ar CC=arm-linux-gnueabi-gcc
RANLIB=arm-linux-gnueabi-gcc-ranlib-4.7 STRIP=arm-linux-gnueabi-strip
CPP=arm-linux-gnueabi-g++ CXX=arm-linux-gnueabi-g++
You shouldn't have to specify stuff like this. These variables should
be set automatically.
Post by $***@nth
Now i am hitting one more issue before earlier one comes.
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[1]: *** [configure-build-libiberty] Error 1
You have to look at the config.log file to see what command failed.
There is more than one config.log file. This would be the file
build-$build/libiberty/config.log. This problem might be due to the
missing --build configure option. if $build isn't x86_64-pc-linux-gnu
or whatever your build machine is, then that is probably why the
configure in this directory failed.

Jim
$rik@nth
2016-03-31 02:37:25 UTC
Permalink
Post by Jim Wilson
Post by $***@nth
Yes. I am using ubuntu 64bit to cross compile GCC to ARM. If i issue
--host=arm-linux-gnueabi then it will pick up default
/usr/arm-linux-gnuebi bins. I would like to pick up my binutils which
are built statically for doing some experiment.
If binutils was built and installed with the same prefix as gcc, then
gcc should automatically find and use it.
By default it is fetching pre-installed binutils while configure if i
won't specify them to pick from where.
Post by Jim Wilson
For cross building a native, you need to build a cross compiler first,
and then put it on your path, in which case the cross built native
should use your cross compiler.
Post by $***@nth
--host=arm-linux-gnueabi --target=arm-linux-gnueabi
You have host and target, but not build. You should specify all three.
Post by $***@nth
AR=arm-linux-gnueabi-ar CC=arm-linux-gnueabi-gcc
RANLIB=arm-linux-gnueabi-gcc-ranlib-4.7 STRIP=arm-linux-gnueabi-strip
CPP=arm-linux-gnueabi-g++ CXX=arm-linux-gnueabi-g++
You shouldn't have to specify stuff like this. These variables should
be set automatically.
You mean if i set --host=arm-linux-gnuebi and
--target=arm-linux-gunebi should automatically pick cross compilers
instead of pointing them? I am just following Linaro website on how to
build cross tool chain
https://wiki.linaro.org/WorkingGroups/ToolChain/BuildingGNUToolchains

Please let me know if there is some more links where i can follow precisely.
Post by Jim Wilson
Post by $***@nth
Now i am hitting one more issue before earlier one comes.
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[1]: *** [configure-build-libiberty] Error 1
You have to look at the config.log file to see what command failed.
There is more than one config.log file. This would be the file
build-$build/libiberty/config.log. This problem might be due to the
missing --build configure option. if $build isn't x86_64-pc-linux-gnu
or whatever your build machine is, then that is probably why the
configure in this directory failed.
Jim
--
Thanks & Regards,
M.Srikanth Kumar.
Jim Wilson
2016-03-31 03:29:33 UTC
Permalink
Post by $***@nth
You mean if i set --host=arm-linux-gnuebi and
--target=arm-linux-gunebi should automatically pick cross compilers
Yes, in theory, it should find CC, AS, AR, etc by itself. Don't
forget that you need to set all 3 of build, host, and target for this
to work.
Post by $***@nth
instead of pointing them? I am just following Linaro website on how to
build cross tool chain
https://wiki.linaro.org/WorkingGroups/ToolChain/BuildingGNUToolchains
That page only talks about a basic cross build. it doesn't talk about
cross building a native.
Post by $***@nth
Please let me know if there is some more links where i can follow precisely.
We call it a "canadian cross" when build != host != target. What you
are trying to do is very similar to a canadian cross, and works
basically the same way. If you do a web search for "build canadian
cross gcc" then you can find some web pages that talk about this. In
general, this isn't well documented, because it is much harder to do a
canadian cross than a regular cross, and it usually requires learning
quite a bit about how gcc builds work in order to be able to do it
successfully.

We have a tool called ABE that we use for builds inside linaro. There
is a wiki page for it at
https://wiki.linaro.org/ABE
I know that this has support for a windows canadian cross build, e.g.
build=x86_64-linux host=i686-w64-mingw3 and then a target or arm or
aarch64. I don't know offhand if it can be used for what you are
trying to do.

Building a native gcc binary is much easier than trying to cross build
a native. You should do a native build if you can.

Jim
$rik@nth
2016-03-31 07:21:16 UTC
Permalink
Post by Jim Wilson
Post by $***@nth
You mean if i set --host=arm-linux-gnuebi and
--target=arm-linux-gunebi should automatically pick cross compilers
Yes, in theory, it should find CC, AS, AR, etc by itself. Don't
forget that you need to set all 3 of build, host, and target for this
to work.
Post by $***@nth
instead of pointing them? I am just following Linaro website on how to
build cross tool chain
https://wiki.linaro.org/WorkingGroups/ToolChain/BuildingGNUToolchains
That page only talks about a basic cross build. it doesn't talk about
cross building a native.
Post by $***@nth
Please let me know if there is some more links where i can follow precisely.
We call it a "canadian cross" when build != host != target. What you
are trying to do is very similar to a canadian cross, and works
basically the same way. If you do a web search for "build canadian
cross gcc" then you can find some web pages that talk about this. In
general, this isn't well documented, because it is much harder to do a
canadian cross than a regular cross, and it usually requires learning
quite a bit about how gcc builds work in order to be able to do it
successfully.
We have a tool called ABE that we use for builds inside linaro. There
is a wiki page for it at
https://wiki.linaro.org/ABE
Thanks you. I will go through this utility for building native toolchain.
Post by Jim Wilson
I know that this has support for a windows canadian cross build, e.g.
build=x86_64-linux host=i686-w64-mingw3 and then a target or arm or
aarch64. I don't know offhand if it can be used for what you are
trying to do.
Building a native gcc binary is much easier than trying to cross build
a native. You should do a native build if you can.
Though this is very new to me. Definitely i will give it a try as you
mentioned this process is very easy to build native gcc binaries. But
here i want to build static binaries and where i need to pass the
Flags to ABE. There is no argument supports to build static tool
chains.
Post by Jim Wilson
Jim
--
Thanks & Regards,
M.Srikanth Kumar.
$rik@nth
2016-03-31 10:30:38 UTC
Permalink
Post by $***@nth
Post by Jim Wilson
Post by $***@nth
You mean if i set --host=arm-linux-gnuebi and
--target=arm-linux-gunebi should automatically pick cross compilers
Yes, in theory, it should find CC, AS, AR, etc by itself. Don't
forget that you need to set all 3 of build, host, and target for this
to work.
Post by $***@nth
instead of pointing them? I am just following Linaro website on how to
build cross tool chain
https://wiki.linaro.org/WorkingGroups/ToolChain/BuildingGNUToolchains
That page only talks about a basic cross build. it doesn't talk about
cross building a native.
Post by $***@nth
Please let me know if there is some more links where i can follow precisely.
We call it a "canadian cross" when build != host != target. What you
are trying to do is very similar to a canadian cross, and works
basically the same way. If you do a web search for "build canadian
cross gcc" then you can find some web pages that talk about this. In
general, this isn't well documented, because it is much harder to do a
canadian cross than a regular cross, and it usually requires learning
quite a bit about how gcc builds work in order to be able to do it
successfully.
We have a tool called ABE that we use for builds inside linaro. There
is a wiki page for it at
https://wiki.linaro.org/ABE
Thanks you. I will go through this utility for building native toolchain.
Post by Jim Wilson
I know that this has support for a windows canadian cross build, e.g.
build=x86_64-linux host=i686-w64-mingw3 and then a target or arm or
aarch64. I don't know offhand if it can be used for what you are
trying to do.
Building a native gcc binary is much easier than trying to cross build
a native. You should do a native build if you can.
Though this is very new to me. Definitely i will give it a try as you
mentioned this process is very easy to build native gcc binaries. But
here i want to build static binaries and where i need to pass the
Flags to ABE. There is no argument supports to build static tool
chains.
I gone through the script and saw there are env settings [--set
{cflags|ldflags|runtestflags|makeflags}=XXX]
Post by $***@nth
Post by Jim Wilson
Jim
--
Thanks & Regards,
M.Srikanth Kumar.
--
Thanks & Regards,
M.Srikanth Kumar.
$rik@nth
2016-04-01 14:10:31 UTC
Permalink
Hi Jim,

I've read the Wiki page and start using abe tool to build cross
compile for ARM on x86 build system. But i am getting below error.
Also --set arch=arm argument is showing the arch is not found while configuring.

/local2/mnt/tools/Linux-kernel/Linaro-GCC/abe/build/snapshots/gcc.git~linaro-gcc-5-branch/libgcc/libgcc2.c:59:1:
error: __fixdfdi undeclared here (not in a function)
/local2/mnt/tools/Linux-kernel/Linaro-GCC/abe/build/snapshots/gcc.git~linaro-gcc-5-branch/libgcc/libgcc2.c:59:1:
error: __aeabi_d2lz defined both normally and as âaliasâ attribute
/local2/mnt/tools/Linux-kernel/Linaro-GCC/abe/build/snapshots/gcc.git~linaro-gcc-5-branch/libgcc/libgcc2.c:59:3:
warning: parameter names (without types) in function declaration
[enabled by default]
/local2/mnt/tools/Linux-kernel/Linaro-GCC/abe/build/snapshots/gcc.git~linaro-gcc-5-branch/libgcc/libgcc2.c:59:3:
warning: parameter names (without types) in function declaration
[enabled by default]
make[2]: *** [_fixdfdi.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/local2/mnt/tools/Linux-kernel/Linaro-GCC/abe/build/snapshots/gcc.git~linaro-gcc-5-branch/libgcc/libgcc2.c:59:1:
error: __fixsfdi undeclared here (not in a function)
/local2/mnt/tools/Linux-kernel/Linaro-GCC/abe/build/snapshots/gcc.git~linaro-gcc-5-branch/libgcc/libgcc2.c:59:1:
error: __aeabi_f2lz defined both normally and as âaliasâ attribute
/local2/mnt/tools/Linux-kernel/Linaro-GCC/abe/build/snapshots/gcc.git~linaro-gcc-5-branch/libgcc/libgcc2.c:59:3:
warning: parameter names (without types) in function declaration
[enabled by default]
/local2/mnt/tools/Linux-kernel/Linaro-GCC/abe/build/snapshots/gcc.git~linaro-gcc-5-branch/libgcc/libgcc2.c:59:3:
warning: parameter names (without types) in function declaration
[enabled by default]
make[2]: *** [_fixsfdi.o] Error 1
/local2/mnt/tools/Linux-kernel/Linaro-GCC/abe/build/snapshots/gcc.git~linaro-gcc-5-branch/libgcc/libgcc2.c:59:1:
error: __fixunssfdi undeclared here (not in a function)
/local2/mnt/tools/Linux-kernel/Linaro-GCC/abe/build/snapshots/gcc.git~linaro-gcc-5-branch/libgcc/libgcc2.c:59:1:
error: __aeabi_f2ulz defined both normally and as âaliasâ attribute
/local2/mnt/tools/Linux-kernel/Linaro-GCC/abe/build/snapshots/gcc.git~linaro-gcc-5-branch/libgcc/libgcc2.c:59:3:
warning: parameter names (without types) in function declaration
[enabled by default]
make[2]: *** [_fixunssfdi.o] Error 1
/local2/mnt/tools/Linux-kernel/Linaro-GCC/abe/build/snapshots/gcc.git~linaro-gcc-5-branch/libgcc/libgcc2.c:59:1:
error: __fixunsdfdi undeclared here (not in a function)
/local2/mnt/tools/Linux-kernel/Linaro-GCC/abe/build/snapshots/gcc.git~linaro-gcc-5-branch/libgcc/libgcc2.c:59:1:
error: __aeabi_d2ulz defined both normally and as âaliasâ attribute
/local2/mnt/tools/Linux-kernel/Linaro-GCC/abe/build/snapshots/gcc.git~linaro-gcc-5-branch/libgcc/libgcc2.c:59:3:
warning: parameter names (without types) in function declaration
[enabled by default]
make[2]: *** [_fixunsdfdi.o] Error 1
Post by $***@nth
Post by $***@nth
Post by Jim Wilson
Post by $***@nth
You mean if i set --host=arm-linux-gnuebi and
--target=arm-linux-gunebi should automatically pick cross compilers
Yes, in theory, it should find CC, AS, AR, etc by itself. Don't
forget that you need to set all 3 of build, host, and target for this
to work.
Post by $***@nth
instead of pointing them? I am just following Linaro website on how to
build cross tool chain
https://wiki.linaro.org/WorkingGroups/ToolChain/BuildingGNUToolchains
That page only talks about a basic cross build. it doesn't talk about
cross building a native.
Post by $***@nth
Please let me know if there is some more links where i can follow precisely.
We call it a "canadian cross" when build != host != target. What you
are trying to do is very similar to a canadian cross, and works
basically the same way. If you do a web search for "build canadian
cross gcc" then you can find some web pages that talk about this. In
general, this isn't well documented, because it is much harder to do a
canadian cross than a regular cross, and it usually requires learning
quite a bit about how gcc builds work in order to be able to do it
successfully.
We have a tool called ABE that we use for builds inside linaro. There
is a wiki page for it at
https://wiki.linaro.org/ABE
Thanks you. I will go through this utility for building native toolchain.
Post by Jim Wilson
I know that this has support for a windows canadian cross build, e.g.
build=x86_64-linux host=i686-w64-mingw3 and then a target or arm or
aarch64. I don't know offhand if it can be used for what you are
trying to do.
Building a native gcc binary is much easier than trying to cross build
a native. You should do a native build if you can.
Though this is very new to me. Definitely i will give it a try as you
mentioned this process is very easy to build native gcc binaries. But
here i want to build static binaries and where i need to pass the
Flags to ABE. There is no argument supports to build static tool
chains.
I gone through the script and saw there are env settings [--set
{cflags|ldflags|runtestflags|makeflags}=XXX]
Post by $***@nth
Post by Jim Wilson
Jim
--
Thanks & Regards,
M.Srikanth Kumar.
--
Thanks & Regards,
M.Srikanth Kumar.
--
Thanks & Regards,
M.Srikanth Kumar.
$rik@nth
2016-04-02 10:00:42 UTC
Permalink
Jim, Need your expertise here.

I've tried building in a different machine and end up with different error.

Command used `../abe.sh --set cflags="-static" --set
ldflags="-pthread" --build x86_64-linux-gnu --host
arm-linux-gnueabi --target arm-linux-gnueabi --build all`

/home/hydlnxbld84/Srikanth/abe/build/snapshots/gcc.git~linaro-gcc-5-branch/gcc/real.h:79:76:
error: size of array test_real_width is negative
[sizeof (REAL_VALUE_TYPE) <= REAL_WIDTH * sizeof (HOST_WIDE_INT) ? 1 : -1];
^
make[2]: *** [c/c-lang.o] Error 1
make[2]: *** Waiting for unfinished jobs....
Post by $***@nth
Hi Jim,
I've read the Wiki page and start using abe tool to build cross
compile for ARM on x86 build system. But i am getting below error.
Also --set arch=arm argument is showing the arch is not found while configuring.
error: __fixdfdi undeclared here (not in a function)
error: __aeabi_d2lz defined both normally and as âaliasâ attribute
warning: parameter names (without types) in function declaration
[enabled by default]
warning: parameter names (without types) in function declaration
[enabled by default]
make[2]: *** [_fixdfdi.o] Error 1
make[2]: *** Waiting for unfinished jobs....
error: __fixsfdi undeclared here (not in a function)
error: __aeabi_f2lz defined both normally and as âaliasâ attribute
warning: parameter names (without types) in function declaration
[enabled by default]
warning: parameter names (without types) in function declaration
[enabled by default]
make[2]: *** [_fixsfdi.o] Error 1
error: __fixunssfdi undeclared here (not in a function)
error: __aeabi_f2ulz defined both normally and as âaliasâ attribute
warning: parameter names (without types) in function declaration
[enabled by default]
make[2]: *** [_fixunssfdi.o] Error 1
error: __fixunsdfdi undeclared here (not in a function)
error: __aeabi_d2ulz defined both normally and as âaliasâ attribute
warning: parameter names (without types) in function declaration
[enabled by default]
make[2]: *** [_fixunsdfdi.o] Error 1
Post by $***@nth
Post by $***@nth
Post by Jim Wilson
Post by $***@nth
You mean if i set --host=arm-linux-gnuebi and
--target=arm-linux-gunebi should automatically pick cross compilers
Yes, in theory, it should find CC, AS, AR, etc by itself. Don't
forget that you need to set all 3 of build, host, and target for this
to work.
Post by $***@nth
instead of pointing them? I am just following Linaro website on how to
build cross tool chain
https://wiki.linaro.org/WorkingGroups/ToolChain/BuildingGNUToolchains
That page only talks about a basic cross build. it doesn't talk about
cross building a native.
Post by $***@nth
Please let me know if there is some more links where i can follow precisely.
We call it a "canadian cross" when build != host != target. What you
are trying to do is very similar to a canadian cross, and works
basically the same way. If you do a web search for "build canadian
cross gcc" then you can find some web pages that talk about this. In
general, this isn't well documented, because it is much harder to do a
canadian cross than a regular cross, and it usually requires learning
quite a bit about how gcc builds work in order to be able to do it
successfully.
We have a tool called ABE that we use for builds inside linaro. There
is a wiki page for it at
https://wiki.linaro.org/ABE
Thanks you. I will go through this utility for building native toolchain.
Post by Jim Wilson
I know that this has support for a windows canadian cross build, e.g.
build=x86_64-linux host=i686-w64-mingw3 and then a target or arm or
aarch64. I don't know offhand if it can be used for what you are
trying to do.
Building a native gcc binary is much easier than trying to cross build
a native. You should do a native build if you can.
Though this is very new to me. Definitely i will give it a try as you
mentioned this process is very easy to build native gcc binaries. But
here i want to build static binaries and where i need to pass the
Flags to ABE. There is no argument supports to build static tool
chains.
I gone through the script and saw there are env settings [--set
{cflags|ldflags|runtestflags|makeflags}=XXX]
Post by $***@nth
Post by Jim Wilson
Jim
--
Thanks & Regards,
M.Srikanth Kumar.
--
Thanks & Regards,
M.Srikanth Kumar.
--
Thanks & Regards,
M.Srikanth Kumar.
--
Thanks & Regards,
M.Srikanth Kumar.
Jim Wilson
2016-04-04 15:57:44 UTC
Permalink
Post by $***@nth
error: size of array test_real_width is negative
[sizeof (REAL_VALUE_TYPE) <= REAL_WIDTH * sizeof (HOST_WIDE_INT) ? 1 : -1];
I don't know offhand how one can get this error. You'd have to look
at the preprocessor output here and try to figure out what wrong with
this calculation. Maybe you accidentally used --build
x86_64-linux-gnu on a 32-bit machine?

Jim
$rik@nth
2016-04-04 18:30:03 UTC
Permalink
Post by Jim Wilson
Post by $***@nth
error: size of array test_real_width is negative
[sizeof (REAL_VALUE_TYPE) <= REAL_WIDTH * sizeof (HOST_WIDE_INT) ? 1 : -1];
I don't know offhand how one can get this error. You'd have to look
at the preprocessor output here and try to figure out what wrong with
this calculation. Maybe you accidentally used --build
x86_64-linux-gnu on a 32-bit machine?
I am issuing abe with `../abe.sh --set cflags="-static" --set
ldflags="-pthread" --host arm-linux-gnueabi --target arm-linux-gnueabi
--build all`
am i configuring something wrong here? Please correct me
Post by Jim Wilson
Jim
--
Thanks & Regards,
M.Srikanth Kumar.
Jim Wilson
2016-04-05 01:14:16 UTC
Permalink
Post by $***@nth
I am issuing abe with `../abe.sh --set cflags="-static" --set
ldflags="-pthread" --host arm-linux-gnueabi --target arm-linux-gnueabi
--build all`
am i configuring something wrong here? Please correct me
That won't work without an arm-linux-gnueabi toolchain in the path.

When I try to build an arm-linux-gnueabi toolchain by dropping the
--host option, I get a glibc build failure
home/wilson/Linaro/tcwg/X-tmp/builds/x86_64-unknown-linux-gnu/arm-linux-gnueabi/glibc.git~release-2.21-master/config.h:4:3:
error: #error "glibc cannot be compiled without optimization"
--set cflags is overriding the default flags instead of adding to
them, so this isn't going to work.

If I try using --set cflags="-O2 -static", then I get an abe option parse error
ERROR (#612): check_directive (--stage requires a directive. abe.sh
found the next -- switch. See --usage for details.' )
This is trying to parse -static thinking it is the abe --stage option
because it accepts -sta* as an abbreviation. Personally, I think all
of the abbreviations should be dropped as useless. Anyways, it seems
it is ignoring the quotes when trying to parse the options. It
appears that using the abe --set cflags option isn't useful, and you
won't be able to build a static toolchain this way.

I successfully built a cross by dropping the cflags and ldflags options.

I then tried to use it to build a canadian cross. The build fails in
gdb, complaining that I don't have a libtermcap library which is true.
This is before it tried to build gcc, so I didn't get any gcc build.

Jim
$rik@nth
2016-04-05 03:18:50 UTC
Permalink
Post by Jim Wilson
Post by $***@nth
I am issuing abe with `../abe.sh --set cflags="-static" --set
ldflags="-pthread" --host arm-linux-gnueabi --target arm-linux-gnueabi
--build all`
am i configuring something wrong here? Please correct me
That won't work without an arm-linux-gnueabi toolchain in the path.
When I try to build an arm-linux-gnueabi toolchain by dropping the
--host option, I get a glibc build failure
error: #error "glibc cannot be compiled without optimization"
--set cflags is overriding the default flags instead of adding to
them, so this isn't going to work.
If I try using --set cflags="-O2 -static", then I get an abe option parse error
ERROR (#612): check_directive (--stage requires a directive. abe.sh
found the next -- switch. See --usage for details.' )
Sure.. I will give it a try by looking more into the usage once to play with it.
Post by Jim Wilson
This is trying to parse -static thinking it is the abe --stage option
because it accepts -sta* as an abbreviation. Personally, I think all
of the abbreviations should be dropped as useless. Anyways, it seems
it is ignoring the quotes when trying to parse the options. It
appears that using the abe --set cflags option isn't useful, and you
won't be able to build a static toolchain this way.
I successfully built a cross by dropping the cflags and ldflags options.
There is no way to build static tool chain by using abe tool at all?
Post by Jim Wilson
I then tried to use it to build a canadian cross. The build fails in
gdb, complaining that I don't have a libtermcap library which is true.
This is before it tried to build gcc, so I didn't get any gcc build.
Jim
--
Thanks & Regards,
M.Srikanth Kumar.
Jim Wilson
2016-04-05 05:42:22 UTC
Permalink
Post by $***@nth
There is no way to build static tool chain by using abe tool at all?
Maybe modify abe/lib/make.sh to add -static directly to LDFLAGS?

Jim
$rik@nth
2016-04-15 13:35:39 UTC
Permalink
Post by Jim Wilson
Post by $***@nth
There is no way to build static tool chain by using abe tool at all?
Maybe modify abe/lib/make.sh to add -static directly to LDFLAGS?
Even this is not helpful. It is returning the same earlier error :(
Post by Jim Wilson
Jim
--
Thanks & Regards,
M.Srikanth Kumar.
Rob Savoye
2016-04-15 13:37:29 UTC
Permalink
Post by Jim Wilson
Post by $***@nth
There is no way to build static tool chain by using abe tool at all?
Maybe modify abe/lib/make.sh to add -static directly to LDFLAGS?
All the config files in ABE (config/*.conf), have a "static_link"
flag, just set it to "yes".

- rob -
$rik@nth
2016-04-18 17:43:49 UTC
Permalink
Post by Rob Savoye
static_link
Thank Rob for the pointers. Actually i am trying to build cross gcc
for ARM aarch 32bit.

I moved all `no` flags to `yes`.

`../abe.sh --set arch=armv7-a --host arm-linux-gnueabi --target
arm-linux-gnueabi --build all`.. Still observing the same issue while
building libgcc
abe/build/snapshots/gcc.git~linaro-gcc-5-branch/libgcc/libgcc2.c:59:1
error: __fixsfdi undeclared here (not in a function)
abe/build/snapshots/gcc.git~linaro-gcc-5-branch/libgcc/libgcc2.c:59:1
error: __aeabi_f2lz defined both normally and as alias attribute

if i drop --host flag.. It compiles properly. But the bins are
generating for x86_64 instead of arm 32bit with dynamic rather than
static as per your pointer.
--
Thanks & Regards,
M.Srikanth Kumar.
Rob Savoye
2016-04-18 18:38:31 UTC
Permalink
Post by $***@nth
`../abe.sh --set arch=armv7-a --host arm-linux-gnueabi --target
arm-linux-gnueabi --build all`.. Still observing the same issue while
building libgcc
if i drop --host flag.. It compiles properly. But the bins are
generating for x86_64 instead of arm 32bit with dynamic rather than
static as per your pointer.
You're trying to cross compile GCC itself to run on an ARM Linux
system ? That's not explicitly supported by ABE. You'd need to first
build a arm-linux-gnueabi cross compiler, and clone the sysroot from
your ARM target. Then it *might* work. ABE primarily builds cross
compilers. For ARM hosted GCC, ABE builds natively.

- rob -
$rik@nth
2016-04-19 03:08:07 UTC
Permalink
Post by Rob Savoye
Post by $***@nth
`../abe.sh --set arch=armv7-a --host arm-linux-gnueabi --target
arm-linux-gnueabi --build all`.. Still observing the same issue while
building libgcc
if i drop --host flag.. It compiles properly. But the bins are
generating for x86_64 instead of arm 32bit with dynamic rather than
static as per your pointer.
You're trying to cross compile GCC itself to run on an ARM Linux
system ? That's not explicitly supported by ABE.
Yes. I want to compile GCC to run on ARM linux.
Post by Rob Savoye
You'd need to first build a arm-linux-gnueabi cross compiler,
Here i am failing to build arm-linux-gnueabi cross compier for ARM
aarch. With the configuraiton it is generating for x86 rather than for
ARM.
Post by Rob Savoye
and clone the sysroot from
your ARM target. Then it *might* work. ABE primarily builds cross
compilers. For ARM hosted GCC, ABE builds natively.
I can do the cloning of sysroot once if i can generate cross compiler for ARM.
Post by Rob Savoye
- rob -
--
Thanks & Regards,
M.Srikanth Kumar.
Rob Savoye
2016-04-19 04:17:29 UTC
Permalink
This post might be inappropriate. Click to display it.
$rik@nth
2016-04-19 11:19:05 UTC
Permalink
Post by Rob Savoye
Post by $***@nth
Post by Rob Savoye
Post by $***@nth
`../abe.sh --set arch=armv7-a --host arm-linux-gnueabi --target
arm-linux-gnueabi --build all`.. Still observing the same issue while
building libgcc
You'd need to first build a arm-linux-gnueabi cross compiler,
Here i am failing to build arm-linux-gnueabi cross compier for ARM
../abe.sh --target arm-linux-gnueabi --build all
How to generate ARM instead of x86_64 - arm. Currently it is doing
x86*->arm. Which i can not run them on ARM processor development
board.
Post by Rob Savoye
It doesn't matter whether this is statically or dynamically linked at
all, it's just to compile the next step.
It you really want to hack this into existence, I'll note that ABE
sets everything up so you can also do manual builds. All the component
builds are located in builds/$host/$target. I commonly do an ABE build,
then cd into a build directory and tweak configure flags, make flags,
etc... The nice thing is that ABE has built all the dependencies, like
binutils, etc... so you only have to hack on one part of the build, like
GCC. You an always manually add --disable-shared --enable-static if you
want. The existing configure options are in the top of config.log. so
it's all easy cut & paste. I do this frequently when debugging ABE.
earlier i used to generate arm gcc static using above flags. But i am
getting few LD erros as it failed to get them from right location
Post by Rob Savoye
If you want to package the binary toolchain after building it, just
add --tarbin when running ABE, and it'll make a tarball you can just
install. That should also work for the ARM GCC executables, although
I've never tested that.
- rob -
--
Thanks & Regards,
M.Srikanth Kumar.
$rik@nth
2016-04-19 03:11:52 UTC
Permalink
Post by Rob Savoye
Post by Jim Wilson
Post by $***@nth
There is no way to build static tool chain by using abe tool at all?
Maybe modify abe/lib/make.sh to add -static directly to LDFLAGS?
All the config files in ABE (config/*.conf), have a "static_link"
flag, just set it to "yes".
All flags are marked to "yes". But still ABE is generating dynamic
bins rather than static. Does it require any other changes as well?

binutils.conf:static_link="yes"
cloog.conf:static_link="yes"
cloog-parma.conf:static_link="yes"
cloog-polylib.conf:static_link="yes"
cloog-ppl.conf:static_link="yes"
eglibc.conf:static_link="yes"
ffmpeg.conf:static_link="yes"
gcc.conf:static_link="yes"
gdb.conf:static_link="yes"
gdbserver.conf:static_link="yes"
gdk-pixbuf.conf:static_link="yes"
glibc.conf:static_link="yes"
glib.conf:static_link="yes"
gmp.conf:static_link="yes"
infrastructure.conf:static_link="yes"
isl.conf:static_link="yes"
libelf.conf:static_link="yes"
llvm.conf:static_link="yes"
make.conf:static_link="yes"
mpc.conf:static_link="yes"
mpfr.conf:static_link="yes"
newlib.conf:static_link="yes"
ppl.conf:static_link="yes"
qemu.conf:static_link="yes"
qt-everywhere-opensource-src.conf:static_link="yes"
zlib.conf:static_link="yes"
Post by Rob Savoye
- rob -
--
Thanks & Regards,
M.Srikanth Kumar.
Jim Wilson
2016-04-04 16:13:14 UTC
Permalink
Post by $***@nth
I've read the Wiki page and start using abe tool to build cross
compile for ARM on x86 build system. But i am getting below error.
Also --set arch=arm argument is showing the arch is not found while configuring.
Abe --set arch= translates into a gcc -march= option. arm isn't a
valid argument for that in an arm toolchain. A valid choice would be
armv7-a for instance. But you shouldn't need an abe arch option
normally. Only if you want a different -march= to be the default.
Post by $***@nth
error: __fixdfdi undeclared here (not in a function)
error: __aeabi_d2lz defined both normally and as âaliasâ attribute
warning: parameter names (without types) in function declaration
[enabled by default]
warning: parameter names (without types) in function declaration
[enabled by default]
make[2]: *** [_fixdfdi.o] Error 1
It isn't obvious what went wrong here. Try looking at the
preprocessor output of the failing gcc command. You didn't mention
the abe command used here.

It may take a little time to learn how to use abe to do a build. Abe
tries to make builds easier, but it doesn't make them easy.

I don't know if abe can be used to do what you want. The linaro
toolchain group doesn't do canadian cross builds except for windows
hosted builds, so we don't have any process to do what you want.
There is a linaro group that builds OS releases that contain native
gcc binaries. I think that they use Open Embedded, but I've never
used Open Embedded, so I don't know how any of that works.

Jim
Loading...