public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* Building a cross-native toolchain to build on ARM-Android for ARM-Android
@ 2014-12-15 13:59 Rein Loopalu
  2014-12-15 15:52 ` Bryan Hundven
  0 siblings, 1 reply; 8+ messages in thread
From: Rein Loopalu @ 2014-12-15 13:59 UTC (permalink / raw)
  To: crossgcc

Replying to my own email here to make a quick update on the status. I
built the cross-native toolchain with statically linked glibc to avoid
(at least temporarily) the need for Bionic libc. If I try to execute
gcc on the device I get error:

Cannot create temporary file in ./: Read-only file system
Aborted

I wonder if I can somehow configure it to create that temporary file
somewhere else?

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Building a cross-native toolchain to build on ARM-Android for ARM-Android
  2014-12-15 13:59 Building a cross-native toolchain to build on ARM-Android for ARM-Android Rein Loopalu
@ 2014-12-15 15:52 ` Bryan Hundven
  2014-12-15 23:21   ` Rein Loopalu
  0 siblings, 1 reply; 8+ messages in thread
From: Bryan Hundven @ 2014-12-15 15:52 UTC (permalink / raw)
  To: Rein Loopalu; +Cc: crossgcc maillist

Rein,

On Mon, Dec 15, 2014 at 5:59 AM, Rein Loopalu <eesti.elanik@gmail.com> wrote:
> Replying to my own email here to make a quick update on the status. I
> built the cross-native toolchain with statically linked glibc to avoid
> (at least temporarily) the need for Bionic libc. If I try to execute
> gcc on the device I get error:
>
> Cannot create temporary file in ./: Read-only file system
> Aborted

I'd guess that the device needs to be "rooted" so that you can get
privileged access to change the root file-system to read/write. Not
really related to crosstool-NG, but good luck!

> I wonder if I can somehow configure it to create that temporary file
> somewhere else?
>
> --
> For unsubscribe information see http://sourceware.org/lists.html#faq
>

-Bryan

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Building a cross-native toolchain to build on ARM-Android for ARM-Android
  2014-12-15 15:52 ` Bryan Hundven
@ 2014-12-15 23:21   ` Rein Loopalu
  2014-12-15 23:31     ` Rein Loopalu
  0 siblings, 1 reply; 8+ messages in thread
From: Rein Loopalu @ 2014-12-15 23:21 UTC (permalink / raw)
  To: Bryan Hundven; +Cc: crossgcc maillist

Thanks

Managed to fix that, but now it is giving me error:

-
FATAL: kernel too old
arm-temp-linux-gnueabi-gcc: internal compiler error: Segmentation
fault (program as)
-

The device kernel info is: Linux version 3.0.8 (gcc version
4.6.x-google 20120106 (prerelease) (GCC) ). I have also set for
C-library the "Minimum kernel version to support (Specific kernel
version)" to 2.6.9 in crosstool-ng options. I am using gcc 4.9.1 and
glibc 2.19 in the build.

3.0.8 > 2.6.9 so what could be the problem?

On Mon, Dec 15, 2014 at 5:52 PM, Bryan Hundven <bryanhundven@gmail.com> wrote:
> Rein,
>
> On Mon, Dec 15, 2014 at 5:59 AM, Rein Loopalu <eesti.elanik@gmail.com> wrote:
>> Replying to my own email here to make a quick update on the status. I
>> built the cross-native toolchain with statically linked glibc to avoid
>> (at least temporarily) the need for Bionic libc. If I try to execute
>> gcc on the device I get error:
>>
>> Cannot create temporary file in ./: Read-only file system
>> Aborted
>
> I'd guess that the device needs to be "rooted" so that you can get
> privileged access to change the root file-system to read/write. Not
> really related to crosstool-NG, but good luck!
>
>> I wonder if I can somehow configure it to create that temporary file
>> somewhere else?
>>
>> --
>> For unsubscribe information see http://sourceware.org/lists.html#faq
>>
>
> -Bryan

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Building a cross-native toolchain to build on ARM-Android for ARM-Android
  2014-12-15 23:21   ` Rein Loopalu
@ 2014-12-15 23:31     ` Rein Loopalu
  2014-12-16  2:26       ` Rein Loopalu
  0 siblings, 1 reply; 8+ messages in thread
From: Rein Loopalu @ 2014-12-15 23:31 UTC (permalink / raw)
  To: Bryan Hundven; +Cc: crossgcc maillist

I also set Linux kernel version in the crosstool-ng Operating System
settings to 3.0.101 since that seems to be closest to the one the
phone is running on.

On Tue, Dec 16, 2014 at 1:20 AM, Rein Loopalu <eesti.elanik@gmail.com> wrote:
> Thanks
>
> Managed to fix that, but now it is giving me error:
>
> -
> FATAL: kernel too old
> arm-temp-linux-gnueabi-gcc: internal compiler error: Segmentation
> fault (program as)
> -
>
> The device kernel info is: Linux version 3.0.8 (gcc version
> 4.6.x-google 20120106 (prerelease) (GCC) ). I have also set for
> C-library the "Minimum kernel version to support (Specific kernel
> version)" to 2.6.9 in crosstool-ng options. I am using gcc 4.9.1 and
> glibc 2.19 in the build.
>
> 3.0.8 > 2.6.9 so what could be the problem?
>
> On Mon, Dec 15, 2014 at 5:52 PM, Bryan Hundven <bryanhundven@gmail.com> wrote:
>> Rein,
>>
>> On Mon, Dec 15, 2014 at 5:59 AM, Rein Loopalu <eesti.elanik@gmail.com> wrote:
>>> Replying to my own email here to make a quick update on the status. I
>>> built the cross-native toolchain with statically linked glibc to avoid
>>> (at least temporarily) the need for Bionic libc. If I try to execute
>>> gcc on the device I get error:
>>>
>>> Cannot create temporary file in ./: Read-only file system
>>> Aborted
>>
>> I'd guess that the device needs to be "rooted" so that you can get
>> privileged access to change the root file-system to read/write. Not
>> really related to crosstool-NG, but good luck!
>>
>>> I wonder if I can somehow configure it to create that temporary file
>>> somewhere else?
>>>
>>> --
>>> For unsubscribe information see http://sourceware.org/lists.html#faq
>>>
>>
>> -Bryan

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Building a cross-native toolchain to build on ARM-Android for ARM-Android
  2014-12-15 23:31     ` Rein Loopalu
@ 2014-12-16  2:26       ` Rein Loopalu
  2014-12-16  2:33         ` Bryan Hundven
  0 siblings, 1 reply; 8+ messages in thread
From: Rein Loopalu @ 2014-12-16  2:26 UTC (permalink / raw)
  To: Bryan Hundven; +Cc: crossgcc maillist

Now I ran 'file' on bin/as, here is the result:
-
arm-and-linux-gnueabi2/bin/as: ELF 32-bit LSB executable, ARM, EABI5
version 1 (SYSV), statically linked, for GNU/Linux 3.15.4, stripped
-


Doing the same for bin/gcc shows Linux 2.6.16. I wonder why are they
different and how can I make it build bin/as for older kernel?

On Tue, Dec 16, 2014 at 1:31 AM, Rein Loopalu <eesti.elanik@gmail.com> wrote:
> I also set Linux kernel version in the crosstool-ng Operating System
> settings to 3.0.101 since that seems to be closest to the one the
> phone is running on.
>
> On Tue, Dec 16, 2014 at 1:20 AM, Rein Loopalu <eesti.elanik@gmail.com> wrote:
>> Thanks
>>
>> Managed to fix that, but now it is giving me error:
>>
>> -
>> FATAL: kernel too old
>> arm-temp-linux-gnueabi-gcc: internal compiler error: Segmentation
>> fault (program as)
>> -
>>
>> The device kernel info is: Linux version 3.0.8 (gcc version
>> 4.6.x-google 20120106 (prerelease) (GCC) ). I have also set for
>> C-library the "Minimum kernel version to support (Specific kernel
>> version)" to 2.6.9 in crosstool-ng options. I am using gcc 4.9.1 and
>> glibc 2.19 in the build.
>>
>> 3.0.8 > 2.6.9 so what could be the problem?
>>
>> On Mon, Dec 15, 2014 at 5:52 PM, Bryan Hundven <bryanhundven@gmail.com> wrote:
>>> Rein,
>>>
>>> On Mon, Dec 15, 2014 at 5:59 AM, Rein Loopalu <eesti.elanik@gmail.com> wrote:
>>>> Replying to my own email here to make a quick update on the status. I
>>>> built the cross-native toolchain with statically linked glibc to avoid
>>>> (at least temporarily) the need for Bionic libc. If I try to execute
>>>> gcc on the device I get error:
>>>>
>>>> Cannot create temporary file in ./: Read-only file system
>>>> Aborted
>>>
>>> I'd guess that the device needs to be "rooted" so that you can get
>>> privileged access to change the root file-system to read/write. Not
>>> really related to crosstool-NG, but good luck!
>>>
>>>> I wonder if I can somehow configure it to create that temporary file
>>>> somewhere else?
>>>>
>>>> --
>>>> For unsubscribe information see http://sourceware.org/lists.html#faq
>>>>
>>>
>>> -Bryan

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Building a cross-native toolchain to build on ARM-Android for ARM-Android
  2014-12-16  2:26       ` Rein Loopalu
@ 2014-12-16  2:33         ` Bryan Hundven
  2014-12-17 15:44           ` Rein Loopalu
  0 siblings, 1 reply; 8+ messages in thread
From: Bryan Hundven @ 2014-12-16  2:33 UTC (permalink / raw)
  To: Rein Loopalu; +Cc: crossgcc maillist

Rein,

On Mon, Dec 15, 2014 at 6:26 PM, Rein Loopalu <eesti.elanik@gmail.com> wrote:
> Now I ran 'file' on bin/as, here is the result:
> -
> arm-and-linux-gnueabi2/bin/as: ELF 32-bit LSB executable, ARM, EABI5
> version 1 (SYSV), statically linked, for GNU/Linux 3.15.4, stripped
> -
>
>
> Doing the same for bin/gcc shows Linux 2.6.16. I wonder why are they
> different and how can I make it build bin/as for older kernel?
>
> On Tue, Dec 16, 2014 at 1:31 AM, Rein Loopalu <eesti.elanik@gmail.com> wrote:
>> I also set Linux kernel version in the crosstool-ng Operating System
>> settings to 3.0.101 since that seems to be closest to the one the
>> phone is running on.
>>
>> On Tue, Dec 16, 2014 at 1:20 AM, Rein Loopalu <eesti.elanik@gmail.com> wrote:
>>> Thanks
>>>
>>> Managed to fix that, but now it is giving me error:
>>>
>>> -
>>> FATAL: kernel too old
>>> arm-temp-linux-gnueabi-gcc: internal compiler error: Segmentation
>>> fault (program as)
>>> -
>>>
>>> The device kernel info is: Linux version 3.0.8 (gcc version
>>> 4.6.x-google 20120106 (prerelease) (GCC) ). I have also set for
>>> C-library the "Minimum kernel version to support (Specific kernel
>>> version)" to 2.6.9 in crosstool-ng options. I am using gcc 4.9.1 and
>>> glibc 2.19 in the build.
>>>
>>> 3.0.8 > 2.6.9 so what could be the problem?
>>>
>>> On Mon, Dec 15, 2014 at 5:52 PM, Bryan Hundven <bryanhundven@gmail.com> wrote:
>>>> Rein,
>>>>
>>>> On Mon, Dec 15, 2014 at 5:59 AM, Rein Loopalu <eesti.elanik@gmail.com> wrote:
>>>>> Replying to my own email here to make a quick update on the status. I
>>>>> built the cross-native toolchain with statically linked glibc to avoid
>>>>> (at least temporarily) the need for Bionic libc. If I try to execute
>>>>> gcc on the device I get error:
>>>>>
>>>>> Cannot create temporary file in ./: Read-only file system
>>>>> Aborted
>>>>
>>>> I'd guess that the device needs to be "rooted" so that you can get
>>>> privileged access to change the root file-system to read/write. Not
>>>> really related to crosstool-NG, but good luck!
>>>>
>>>>> I wonder if I can somehow configure it to create that temporary file
>>>>> somewhere else?
>>>>>
>>>>> --
>>>>> For unsubscribe information see http://sourceware.org/lists.html#faq
>>>>>
>>>>
>>>> -Bryan

I truly think that crosstool-ng is not the tool you are looking for.
Try this:

mkdir ~/bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod u+x ~/bin/repo
export PATH="$HOME/bin:$PATH"
mkdir ~/android-toolchain
cd ~/android-toolchain
repo init -u https://android.googlesource.com/toolchain/manifest
repo sync

and read the build/README file for help.
This is how the official android toolchains are built.

-Bryan

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Building a cross-native toolchain to build on ARM-Android for ARM-Android
  2014-12-16  2:33         ` Bryan Hundven
@ 2014-12-17 15:44           ` Rein Loopalu
  0 siblings, 0 replies; 8+ messages in thread
From: Rein Loopalu @ 2014-12-17 15:44 UTC (permalink / raw)
  To: Bryan Hundven; +Cc: crossgcc maillist

bin/as was a Linux 3.15.4 executable because I forgot I had selected
that as the target's Operating System when building the
cross-compiler. After changing that to an older version I built the
two toolchains again and now the native compiler is working properly.

On Tue, Dec 16, 2014 at 4:33 AM, Bryan Hundven <bryanhundven@gmail.com> wrote:
> Rein,
>
> On Mon, Dec 15, 2014 at 6:26 PM, Rein Loopalu <eesti.elanik@gmail.com> wrote:
>> Now I ran 'file' on bin/as, here is the result:
>> -
>> arm-and-linux-gnueabi2/bin/as: ELF 32-bit LSB executable, ARM, EABI5
>> version 1 (SYSV), statically linked, for GNU/Linux 3.15.4, stripped
>> -
>>
>>
>> Doing the same for bin/gcc shows Linux 2.6.16. I wonder why are they
>> different and how can I make it build bin/as for older kernel?
>>
>> On Tue, Dec 16, 2014 at 1:31 AM, Rein Loopalu <eesti.elanik@gmail.com> wrote:
>>> I also set Linux kernel version in the crosstool-ng Operating System
>>> settings to 3.0.101 since that seems to be closest to the one the
>>> phone is running on.
>>>
>>> On Tue, Dec 16, 2014 at 1:20 AM, Rein Loopalu <eesti.elanik@gmail.com> wrote:
>>>> Thanks
>>>>
>>>> Managed to fix that, but now it is giving me error:
>>>>
>>>> -
>>>> FATAL: kernel too old
>>>> arm-temp-linux-gnueabi-gcc: internal compiler error: Segmentation
>>>> fault (program as)
>>>> -
>>>>
>>>> The device kernel info is: Linux version 3.0.8 (gcc version
>>>> 4.6.x-google 20120106 (prerelease) (GCC) ). I have also set for
>>>> C-library the "Minimum kernel version to support (Specific kernel
>>>> version)" to 2.6.9 in crosstool-ng options. I am using gcc 4.9.1 and
>>>> glibc 2.19 in the build.
>>>>
>>>> 3.0.8 > 2.6.9 so what could be the problem?
>>>>
>>>> On Mon, Dec 15, 2014 at 5:52 PM, Bryan Hundven <bryanhundven@gmail.com> wrote:
>>>>> Rein,
>>>>>
>>>>> On Mon, Dec 15, 2014 at 5:59 AM, Rein Loopalu <eesti.elanik@gmail.com> wrote:
>>>>>> Replying to my own email here to make a quick update on the status. I
>>>>>> built the cross-native toolchain with statically linked glibc to avoid
>>>>>> (at least temporarily) the need for Bionic libc. If I try to execute
>>>>>> gcc on the device I get error:
>>>>>>
>>>>>> Cannot create temporary file in ./: Read-only file system
>>>>>> Aborted
>>>>>
>>>>> I'd guess that the device needs to be "rooted" so that you can get
>>>>> privileged access to change the root file-system to read/write. Not
>>>>> really related to crosstool-NG, but good luck!
>>>>>
>>>>>> I wonder if I can somehow configure it to create that temporary file
>>>>>> somewhere else?
>>>>>>
>>>>>> --
>>>>>> For unsubscribe information see http://sourceware.org/lists.html#faq
>>>>>>
>>>>>
>>>>> -Bryan
>
> I truly think that crosstool-ng is not the tool you are looking for.
> Try this:
>
> mkdir ~/bin
> curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
> chmod u+x ~/bin/repo
> export PATH="$HOME/bin:$PATH"
> mkdir ~/android-toolchain
> cd ~/android-toolchain
> repo init -u https://android.googlesource.com/toolchain/manifest
> repo sync
>
> and read the build/README file for help.
> This is how the official android toolchains are built.
>
> -Bryan

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Building a cross-native toolchain to build on ARM-Android for ARM-Android
@ 2014-12-14 12:58 Rein Loopalu
  0 siblings, 0 replies; 8+ messages in thread
From: Rein Loopalu @ 2014-12-14 12:58 UTC (permalink / raw)
  To: crossgcc

So far I have managed to build a cross-compiler (builds on x86_64
Linux, targets ARM) with crosstool-ng, and if I compile a binary with
it while adding the -mandroid option (enables Bionic libc among other
things upon compilation, see
https://gcc.gnu.org/onlinedocs/gcc/GNU_002fLinux-Options.html) and
giving --sysroot the location of an "usr" directory which contains
headers and libraries provided by Android NDK, the binary will indeed
work on Android.

I have also done the cross-native implementation steps for
scripts/crosstool-ng.sh.in listed in here:
https://sourceware.org/ml/crossgcc/2010-03/msg00010.html

Now since Android uses Bionic libc I am figuring I will need to add
the -mandroid option somewhere. If I put it into the Extra build
compiler flags then the toolchain build will fail at 'Installing GMP
for build' with error 'could not find a working compiler'. If I put it
into Extra host compiler flags then it will fail at installing GMP for
host with same error. So I am thinking that perhaps hard-coding it
into the scripts somewhere might do the trick, or is it a lot more
complicated than that?

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-12-17 15:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-15 13:59 Building a cross-native toolchain to build on ARM-Android for ARM-Android Rein Loopalu
2014-12-15 15:52 ` Bryan Hundven
2014-12-15 23:21   ` Rein Loopalu
2014-12-15 23:31     ` Rein Loopalu
2014-12-16  2:26       ` Rein Loopalu
2014-12-16  2:33         ` Bryan Hundven
2014-12-17 15:44           ` Rein Loopalu
  -- strict thread matches above, loose matches on Subject: below --
2014-12-14 12:58 Rein Loopalu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).