[Bug libffi/21782] configure: error: unknown endianess

2005-05-30 Thread papadopo at shfj dot cea dot fr

--- Additional Comments From papadopo at shfj dot cea dot fr  2005-05-30 
07:50 ---
This program builds just fine:

$ cat  conftest.c
main () {
  /* Are we little or big endian?  From HarbisonSteele.  */
  union
  {
long l;
char c[sizeof (long)];
  } u;
  u.l = 1;
  exit (u.c[sizeof (long) - 1] == 1);
}
$ 
$ /export/Plocal/GCC-3.3.6/gcc/xgcc -B/export/Plocal/GCC-3.3.6/gcc/
-B/usr/local/gcc-3.3.6/sparc-sun-solaris2.8/bin/
-B/usr/local/gcc-3.3.6/sparc-sun-solaris2.8/lib/ -isystem
/usr/local/gcc-3.3.6/sparc-sun-solaris2.8/include -c -O2 -g -O2  conftest.c
$ echo $?
0
$ 

As far as I can understand the original error message in config.log is:

[...]
configure: In function `main':
configure:3440: error: `bogus' undeclared (first use in this function)
configure:3440: error: (Each undeclared identifier is reported only once
configure:3440: error: for each function it appears in.)
configure:3440: error: syntax error before endian
[...]

and it applies to:

#include confdefs.h
#include sys/types.h
#include sys/param.h
int main() {

#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
 bogus endian macros
#endif
; return 0; }

In the first test, the one that fails, none of BYTE_ORDER, BIG_ENDIAN or
LITTLE_ENDIAN are defined. The configure script then runs a second test which
doesn't fail as shown above. Somehow the configure script takes into account the
first failure.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21782


[Bug libffi/21782] configure: error: unknown endianess

2005-05-30 Thread ebotcazou at gcc dot gnu dot org

--- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-05-30 
09:00 ---
 $ /export/Plocal/GCC-3.3.6/gcc/xgcc -B/export/Plocal/GCC-3.3.6/gcc/
 -B/usr/local/gcc-3.3.6/sparc-sun-solaris2.8/bin/
 -B/usr/local/gcc-3.3.6/sparc-sun-solaris2.8/lib/ -isystem
 /usr/local/gcc-3.3.6/sparc-sun-solaris2.8/include -c -O2 -g -O2  conftest.c

You have attached the wrong config.log file.  Look at the global log file, the
problem is in sparc-sun-solaris2.8/sparcv9/libffi.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21782


[Bug libffi/21782] configure: error: unknown endianess

2005-05-30 Thread papadopo at shfj dot cea dot fr

--- Additional Comments From papadopo at shfj dot cea dot fr  2005-05-30 
09:35 ---
In the 64-bit case, again none of BYTE_ORDER, BIG_ENDIAN or LITTLE_ENDIAN are
defined. As far as I can understand, the configure script stops there and
doesn't run additional tests as in the 32-bit case.
Is there anything else I can test?

$ cat  conftest.c
main () {
  /* Are we little or big endian?  From HarbisonSteele.  */
  union
  {
long l;
char c[sizeof (long)];
  } u;
  u.l = 1;
  exit (u.c[sizeof (long) - 1] == 1);
}
$ 
$ /export/Plocal/GCC-3.3.6/gcc/xgcc -B/export/Plocal/GCC-3.3.6/gcc/
-B/usr/local/gcc-3.3.6/sparc-sun-solaris2.8/bin/
-B/usr/local/gcc-3.3.6/sparc-sun-solaris2.8/lib/ -isystem
/usr/local/gcc-3.3.6/sparc-sun-solaris2.8/include  -m64 -c -O2 -g -O2  
conftest.c
$ 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21782


[Bug libffi/21782] configure: error: unknown endianess

2005-05-30 Thread ebotcazou at gcc dot gnu dot org

--- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-05-30 
09:38 ---
checking whether byte ordering is bigendian... cross-compiling... 
unknown
checking to probe for byte ordering... guessing bigendian ...  
unknown
configure: error: unknown endianess - sorry
gmake[1]: *** [configure-target-libffi] Error 1
gmake[1]: Leaving directory `/export/Plocal/GCC-3.3.6'
gmake: *** [bootstrap] Error 2

Apparently something went astray in the configure script for the 64-bit library,
while all worked fine for the 32-bit library.  There have been no changes at
toplevel or in the libffi directory since 3.3.4 was released one year ago.
I think you should give it another try.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21782


[Bug libffi/21782] configure: error: unknown endianess

2005-05-30 Thread ebotcazou at gcc dot gnu dot org

--- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-05-30 
09:40 ---
 I think you should give it another try.

rm -r sparc-sun-solaris2.8/libffi
rm -r sparc-sun-solaris2.8/sparcv9/libffi
gmake all-target-libffi


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21782


[Bug libffi/21782] configure: error: unknown endianess

2005-05-30 Thread ebotcazou at gcc dot gnu dot org

--- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-05-30 
10:38 ---
 $ /export/Plocal/GCC-3.3.6/gcc/xgcc -B/export/Plocal/GCC-3.3.6/gcc/
 -B/usr/local/gcc-3.3.6/sparc-sun-solaris2.8/bin/
 -B/usr/local/gcc-3.3.6/sparc-sun-solaris2.8/lib/ -isystem
 /usr/local/gcc-3.3.6/sparc-sun-solaris2.8/include  -m64 -c -O2 -g -O2 
 conftest.c

That's not exactly the command line, remove the -c and run the executable.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21782


[Bug libffi/21782] configure: error: unknown endianess

2005-05-30 Thread papadopo at shfj dot cea dot fr

--- Additional Comments From papadopo at shfj dot cea dot fr  2005-05-30 
11:13 ---
This has to be the command line.
All I did was copying/pasting from the config.log file.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21782


[Bug libffi/21782] configure: error: unknown endianess

2005-05-30 Thread papadopo at shfj dot cea dot fr

--- Additional Comments From papadopo at shfj dot cea dot fr  2005-05-30 
11:39 ---
I tried anyway:

$ /export/Plocal/GCC-3.3.6/gcc/xgcc -B/export/Plocal/GCC-3.3.6/gcc/
-B/usr/local/gcc-3.3.6/sparc-sun-solaris2.8/bin/
-B/usr/local/gcc-3.3.6/sparc-sun-solaris2.8/lib/ -isystem
/usr/local/gcc-3.3.6/sparc-sun-solaris2.8/include  -m64 -o conftest -O2 -g -O2
conftest.c
$ 
$ ./conftest
ld.so.1: ./conftest: fatal: /usr/local/lib/libgcc_s.so.1: wrong ELF class:
ELFCLASS32
Killed
$ 
$ env LD_LIBRARY_PATH=/export/Plocal/GCC-3.3.6/gcc/sparcv9 ./conftest
$ echo $?
1
$ 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21782


[Bug libffi/21782] configure: error: unknown endianess

2005-05-30 Thread ebotcazou at gcc dot gnu dot org

--- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-05-30 
12:22 ---
  $ /export/Plocal/GCC-3.3.6/gcc/xgcc -B/export/Plocal/GCC-3.3.6/gcc/
 -B/usr/local/gcc-3.3.6/sparc-sun-solaris2.8/bin/
 -B/usr/local/gcc-3.3.6/sparc-sun-solaris2.8/lib/ -isystem
 /usr/local/gcc-3.3.6/sparc-sun-solaris2.8/include  -m64 -o conftest -O2 -g -O2
 conftest.c
 $ 
 $ ./conftest
 ld.so.1: ./conftest: fatal: /usr/local/lib/libgcc_s.so.1: wrong ELF class:
 ELFCLASS32
 Killed

Ugh.  Could you add -v to the command line?

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21782


[Bug libffi/21782] configure: error: unknown endianess

2005-05-30 Thread papadopo at shfj dot cea dot fr

--- Additional Comments From papadopo at shfj dot cea dot fr  2005-05-30 
12:43 ---
We're heading in the wrong direction.

I don't see how '-v' can help. The problem is just that LD_LIBRARY_PATH contains
/usr/local/lib which contains a link to the 32-bit libgcc_s.so.1 library of gcc
4. Once I reset LD_LIBRARY_PATH running 'conftest' works:

$ file conftest
conftest:   ELF 64-bit MSB executable SPARCV9 Version 1, dynamically 
linked, not
stripped
$ 
$ ldd conftest
libgcc_s.so.1 = /usr/local/lib/libgcc_s.so.1  - wrong ELF 
class: ELFCLASS32
libc.so.1 = /usr/lib/64/libc.so.1
libdl.so.1 =/usr/lib/64/libdl.so.1
/usr/platform/SUNW,Sun-Blade-1000/lib/sparcv9/libc_psr.so.1
$ 
$ env ldd conftest
libgcc_s.so.1 = 
/export/Plocal/GCC-3.3.6/gcc/sparcv9/libgcc_s.so.1
libc.so.1 = /usr/lib/64/libc.so.1
libdl.so.1 =/usr/lib/64/libdl.so.1
/usr/platform/SUNW,Sun-Blade-1000/lib/sparcv9/libc_psr.so.1
$ 
$ file -h /usr/local/lib/libgcc_s.so.1
/usr/local/lib/libgcc_s.so.1:   symbolic link to ../gcc-4.0.0/lib/libgcc_s.so.1
$ 


I assume the configure script resets LD_LIBRARY_PATH itself (otherwise it would
hardly be robust) so this is not an issue.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21782


[Bug libffi/21782] configure: error: unknown endianess

2005-05-30 Thread papadopo at shfj dot cea dot fr

--- Additional Comments From papadopo at shfj dot cea dot fr  2005-05-30 
12:44 ---
(In reply to comment #20)
 $ env ldd conftest

Instead it should read:
env LD_LIBRARY_PATH=/export/Plocal/GCC-3.3.6/gcc/sparcv9 ldd conftest

I don't know what went wrong while copying/pasting.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21782


[Bug libffi/21782] configure: error: unknown endianess

2005-05-30 Thread papadopo at shfj dot cea dot fr

--- Additional Comments From papadopo at shfj dot cea dot fr  2005-05-30 
12:59 ---
See:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libffi/Makefile.am#rev1.40
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libffi/Makefile.in#rev1.51

These changes must somehow be related to my problems with gcc 3.3.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21782


[Bug libffi/21782] configure: error: unknown endianess

2005-05-30 Thread ebotcazou at gcc dot gnu dot org

--- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-05-30 
13:01 ---
 We're heading in the wrong direction.
 
 I don't see how '-v' can help. The problem is just that LD_LIBRARY_PATH 
 contains
 /usr/local/lib which contains a link to the 32-bit libgcc_s.so.1 library of 
 gcc
 4.

The problem is that conftest is not supposed to depend on libgcc_s so it would
be nice to print the link command line.  Try also to add -static-libgcc to the
GCC command line.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21782


[Bug libffi/21782] configure: error: unknown endianess

2005-05-30 Thread ebotcazou at gcc dot gnu dot org

--- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-05-30 
14:40 ---
 Aaah... You mean adding '-v' to 'xgcc', not to 'conftest' itself. My wrong.

Yup, sorry for being too vague.

 Please find the output of the following command attached.

The problem stems from -lgcc --as-needed -lgcc_s_sparcv9 --no-as-needed -lc
-lgcc --as-needed -lgcc_s_sparcv9 --no-as-needed passed to the linker.  There
are probably undefined weak symbols in conftest that resolve to symbols in
libgcc_s.  Could you run readelf --syms conftest | grep UND?

--as-needed/--no-as-needed has been introduced by the 2.15 linker and the
compiler autodetects it.  Now, because Solaris doesn't use the --eh-frame-hdr
optimization, there are probably EH-related undefined weak symbols in every
single executable.  The end result is that libgcc_s is always needed, so the
default has effectively been switched from -static-libgcc to -shared-libgcc.
That's PR bootstrap/14992.

This has been correct in 4.x by:

2004-04-23  Alan Modra  [EMAIL PROTECTED]

PR bootstrap/14992
* gcc.c (init_gcc_specs): Test USE_LD_AS_NEEDED, not HAVE_LD_AS_NEEDED.
* config/linux.h (USE_LD_AS_NEEDED): Define.
* gcc/config/alpha/linux.h (USE_LD_AS_NEEDED): Define.
* gcc/config/arm/linux-elf.h (USE_LD_AS_NEEDED): Define.
* gcc/config/rs6000/linux.h (USE_LD_AS_NEEDED): Define.
* gcc/config/rs6000/linux64.h (USE_LD_AS_NEEDED): Define.
* gcc/config/sh/linux.h (USE_LD_AS_NEEDED): Define.
* gcc/config/sparc/linux.h (USE_LD_AS_NEEDED): Define.
* gcc/config/sparc/linux64.h (USE_LD_AS_NEEDED): Define.

and 3.4.x by

2004-04-18  Alan Modra  [EMAIL PROTECTED]

PR bootstrap/14992
* configure.ac: Define HAVE_LD_AS_NEEDED only for linux.
* configure: Regenerate.
* gcc.c (init_gcc_specs): Revert earlier change.

but not in 3.3.x.


-- 
   What|Removed |Added

  BugsThisDependsOn||14992
 Status|WAITING |NEW
 Ever Confirmed||1
   Last reconfirmed|-00-00 00:00:00 |2005-05-30 14:40:07
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21782


[Bug libffi/21782] configure: error: unknown endianess

2005-05-27 Thread papadopo at shfj dot cea dot fr

--- Additional Comments From papadopo at shfj dot cea dot fr  2005-05-27 
12:38 ---
Created an attachment (id=8979)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8979action=view)
complete build log, output of gmake bootstrap


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21782


[Bug libffi/21782] configure: error: unknown endianess

2005-05-27 Thread papadopo at shfj dot cea dot fr

--- Additional Comments From papadopo at shfj dot cea dot fr  2005-05-27 
12:40 ---
Created an attachment (id=8980)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8980action=view)
failing configure log: sparc-sun-solaris2.8/libffi/config.log


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21782


[Bug libffi/21782] configure: error: unknown endianess

2005-05-27 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-27 
13:15 ---
You should use --disable-multilib as documented.

*** This bug has been marked as a duplicate of 6237 ***

-- 
   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21782


[Bug libffi/21782] configure: error: unknown endianess

2005-05-27 Thread papadopo at shfj dot cea dot fr

--- Additional Comments From papadopo at shfj dot cea dot fr  2005-05-27 
13:35 ---
1) I'm not sure this is a duplicate. The workstation I'm using is fully 64-bit
functional:
$ isainfo -v
64-bit sparcv9 applications
32-bit sparc applications
$ 
Both gcc-3.4.4 and gcc-4.0.0 build fine without --disable-multilib.

2) This looks like a regression since --disable-multilib wasn't needed for
earlier releases of gcc 3.3 on the same machine.

3) In any case, shouldn't this be detected while configuring gcc instead of
later during the build process?


-- 
   What|Removed |Added

 Status|RESOLVED|UNCONFIRMED
 Resolution|DUPLICATE   |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21782


[Bug libffi/21782] configure: error: unknown endianess

2005-05-27 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-27 
13:36 ---
Nothing has changed to libffi since 3.3.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21782


[Bug libffi/21782] configure: error: unknown endianess

2005-05-27 Thread papadopo at shfj dot cea dot fr

--- Additional Comments From papadopo at shfj dot cea dot fr  2005-05-27 
13:43 ---
Nothing has changed on my machine either except:

* I've upgraded the Sun assembler because of this:
http://gcc.gnu.org/ml/gcc/2005-05/msg00509.html
I'm using GNU binutils for this build anyway, so it shouldn't matter.

* I'm using gcc 4.0.0 to bootstrap gcc 3.3.6. It worked for gcc 3.4.4 just a few
hours ago. Are there maybe known issues with bootstrapping using gcc 4?

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21782


[Bug libffi/21782] configure: error: unknown endianess

2005-05-27 Thread papadopo at shfj dot cea dot fr

--- Additional Comments From papadopo at shfj dot cea dot fr  2005-05-27 
13:52 ---
The last version i had built in the gcc 3.3 series was 3.3.4. It had probably
been bootstrapped with gcc 3.3.3 and I was using GNU binutils 2.15 at that time.

Also maybe this is not related to changes in libffi? In which case sorry for
entering the wrong component. Doesn't the libffi configure/build process inherit
some parameters from the global configure/build process?

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21782


[Bug libffi/21782] configure: error: unknown endianess

2005-05-27 Thread ebotcazou at gcc dot gnu dot org

--- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-05-27 
14:40 ---
Look at config.log and try to compile the last configure test using the same
command line:

main () {
  /* Are we little or big endian?  From HarbisonSteele.  */
  union
  {
long l;
char c[sizeof (long)];
  } u;
  u.l = 1;
  exit (u.c[sizeof (long) - 1] == 1);
}

-- 
   What|Removed |Added

 CC||ebotcazou at gcc dot gnu dot
   ||org
 Status|UNCONFIRMED |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21782