Re: [Android] -fpic default option

2012-11-20 Thread Alexander Ivchenko
> If the driver can be sure that an executable is being compiled > (which is a challenge in general case, but simple cases -- > compilation of GCC testsuites -- can be accommodated) I totally agree here that it could be a challenge. Also it could be quite confusing: if the user wants to get assemb

Re: [Android] -fpic default option

2012-11-18 Thread Maxim Kuvyrkov
On 18/11/2012, at 7:50 AM, Alexander Ivchenko wrote: > You are right, we are talking about the same things. The only open > question I see is regarding: > > In other cases we can safely assume > that the executable will be created and > in such case it would be a good idea to use -fPI

Re: [Android] -fpic default option

2012-11-17 Thread Alexander Ivchenko
You are right, we are talking about the same things. The only open question I see is regarding: In other cases we can safely assume that the executable will be created and in such case it would be a good idea to use -fPIE. >> I don't see why it would be a good idea to use -fPIE for

Re: [Android] -fpic default option

2012-11-15 Thread Maxim Kuvyrkov
On 15/11/2012, at 10:39 PM, Alexander Ivchenko wrote: >>> The canonical way of building native applications for Android is to add >>> -fno-pic to the compiler flags. > That’s true for programs in userspace, but for Android system-level > programs (standalone executables) like system tools, consol

Re: [Android] -fpic default option

2012-11-15 Thread Alexander Ivchenko
>> The canonical way of building native applications for Android is to add >> -fno-pic to the compiler flags. That’s true for programs in userspace, but for Android system-level programs (standalone executables) like system tools, console apps or tests it seems -fpic doesn’t make much sense. >> T

Re: [Android] -fpic default option

2012-11-14 Thread H.J. Lu
On Wed, Nov 14, 2012 at 5:26 AM, Alexander Ivchenko wrote: > By default in Android we always compile with -fpic or -fPIC, even when > compiling executable. Because of that we have some test fails on > Android: > > For example: > gcc/testsuite/gcc.target/i386/pr47312.c > /* { dg-do run } */ > /* {

Re: [Android] -fpic default option

2012-11-14 Thread Maxim Kuvyrkov
On 15/11/2012, at 2:26 AM, Alexander Ivchenko wrote: > By default in Android we always compile with -fpic or -fPIC, even when > compiling executable. Because of that we have some test fails on > Android: > > For example: > gcc/testsuite/gcc.target/i386/pr47312.c > /* { dg-do run } */ > /* { dg-op

[Android] -fpic default option

2012-11-14 Thread Alexander Ivchenko
By default in Android we always compile with -fpic or -fPIC, even when compiling executable. Because of that we have some test fails on Android: For example: gcc/testsuite/gcc.target/i386/pr47312.c /* { dg-do run } */ /* { dg-options "-O2" } */ void exit (int); void noreturn_autodetection_failed