Bug 64779 - [5 Regression] libffi/src/x86/sysv.S:864: Error: junk at end of line, first unrecognized character is `@'
Summary: [5 Regression] libffi/src/x86/sysv.S:864: Error: junk at end of line, first u...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libffi (show other bugs)
Version: 5.0
: P1 critical
Target Milestone: 5.0
Assignee: Richard Henderson
URL:
Keywords: build
Depends on:
Blocks:
 
Reported: 2015-01-24 18:59 UTC by Gerald Pfeifer
Modified: 2015-01-28 23:25 UTC (History)
3 users (show)

See Also:
Host: i386-unknown-freebsd10.0
Target: i386-unknown-freebsd10.0
Build:
Known to work:
Known to fail:
Last reconfirmed: 2015-01-26 00:00:00


Attachments
OBJ-0126-1523/i386-unknown-freebsd10.1/libffi/config.log (8.41 KB, text/x-log)
2015-01-26 23:40 UTC, Gerald Pfeifer
Details
An untested patch (344 bytes, patch)
2015-01-27 00:48 UTC, H.J. Lu
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gerald Pfeifer 2015-01-24 18:59:54 UTC
Since the last set of libffi changes, for about 10 days, bootstrap
fails on i386-unknown-freebsd10.0:

libtool: compile:  /scratch2/tmp/gerald/OBJ-0124-0939/./gcc/xgcc -B/scratch2/tmp
/gerald/OBJ-0124-0939/./gcc/ -B/home/gerald/gcc-ref10-i386/i386-unknown-freebsd1
0.1/bin/ -B/home/gerald/gcc-ref10-i386/i386-unknown-freebsd10.1/lib/ -isystem /h
ome/gerald/gcc-ref10-i386/i386-unknown-freebsd10.1/include -isystem /home/gerald
/gcc-ref10-i386/i386-unknown-freebsd10.1/sys-include -DHAVE_CONFIG_H -I. -I/scra
tch2/tmp/gerald/gcc-HEAD/libffi -I. -I/scratch2/tmp/gerald/gcc-HEAD/libffi/inclu
de -Iinclude -I/scratch2/tmp/gerald/gcc-HEAD/libffi/src -I. -I/scratch2/tmp/gera
ld/gcc-HEAD/libffi/include -Iinclude -I/scratch2/tmp/gerald/gcc-HEAD/libffi/src
-g -O2 -MT src/x86/sysv.lo -MD -MP -MF src/x86/.deps/sysv.Tpo -c /scratch2/tmp/g
erald/gcc-HEAD/libffi/src/x86/sysv.S  -fPIC -DPIC -o src/x86/.libs/sysv.o
/scratch2/tmp/gerald/gcc-HEAD/libffi/src/x86/sysv.S: Assembler messages:
/scratch2/tmp/gerald/gcc-HEAD/libffi/src/x86/sysv.S:864: Error: junk at end of l
ine, first unrecognized character is `@'
/scratch2/tmp/gerald/gcc-HEAD/libffi/src/x86/sysv.S:886: Error: junk at end of l
ine, first unrecognized character is `@'
/scratch2/tmp/gerald/gcc-HEAD/libffi/src/x86/sysv.S:898: Error: junk at end of l
ine, first unrecognized character is `@'
/scratch2/tmp/gerald/gcc-HEAD/libffi/src/x86/sysv.S:910: Error: junk at end of l
ine, first unrecognized character is `@'
/scratch2/tmp/gerald/gcc-HEAD/libffi/src/x86/sysv.S:938: Error: junk at end of l
ine, first unrecognized character is `@'
/scratch2/tmp/gerald/gcc-HEAD/libffi/src/x86/sysv.S:950: Error: junk at end of l
ine, first unrecognized character is `@'
/scratch2/tmp/gerald/gcc-HEAD/libffi/src/x86/sysv.S:964: Error: junk at end of l
ine, first unrecognized character is `@'
/scratch2/tmp/gerald/gcc-HEAD/libffi/src/x86/sysv.S:983: Error: junk at end of l
ine, first unrecognized character is `@'
/scratch2/tmp/gerald/gcc-HEAD/libffi/src/x86/sysv.S:1007: Error: junk at end of
line, first unrecognized character is `@'
Makefile:1177: recipe for target 'src/x86/sysv.lo' failed
gmake[4]: *** [src/x86/sysv.lo] Error 1
gmake[4]: Leaving directory '/scratch2/tmp/gerald/OBJ-0124-0939/i386-unknown-fre
ebsd10.1/libffi'
Comment 1 Jakub Jelinek 2015-01-26 14:02:56 UTC
What errors do you get on
echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
gcc -c conftest.s
(i.e. why HAVE_AS_X86_PCREL isn't defined for you)?
Comment 2 Gerald Pfeifer 2015-01-26 17:33:00 UTC
I built GCC configured --without-libgcj --without-libffi and the result works
just fine on your testcase:

% ~/gcc-ref10-i386/bin/gcc -c conftest.s 

In case this provide some insight, here the same with gcc -v:

% ~/gcc-ref10-i386/bin/gcc -v -c conftest.s
Using built-in specs.
COLLECT_GCC=/home/gerald/gcc-ref10-i386/bin/gcc
Target: i386-unknown-freebsd10.1
Configured with: /scratch2/tmp/gerald/gcc-HEAD/configure --prefix=/home/gerald/gcc-ref10-i386 --disable-libgcj --without-libffi --with-gmp=/home/gerald/10-i386 --with-as=/home/gerald/10-i386/bin/as --with-ld=/home/gerald/10-i386/bin/ld
Thread model: posix
gcc version 5.0.0 20150125 (experimental) (GCC) 
COLLECT_GCC_OPTIONS='-v' '-c' '-mtune=generic' '-march=i486'
 /home/gerald/10-i386/bin/as -v -o conftest.o conftest.s
GNU assembler version 2.23.2 (i386-portbld-freebsd10.0) using BFD version (GNU Binutils) 2.23.2
COMPILER_PATH=/home/gerald/gcc-ref10-i386/libexec/gcc/i386-unknown-freebsd10.1/5.0.0/:/home/gerald/gcc-ref10-i386/libexec/gcc/i386-unknown-freebsd10.1/5.0.0/:/home/gerald/gcc-ref10-i386/libexec/gcc/i386-unknown-freebsd10.1/:/home/gerald/gcc-ref10-i386/lib/gcc/i386-unknown-freebsd10.1/5.0.0/:/home/gerald/gcc-ref10-i386/lib/gcc/i386-unknown-freebsd10.1/
LIBRARY_PATH=/home/gerald/gcc-ref10-i386/lib/gcc/i386-unknown-freebsd10.1/5.0.0/:/home/gerald/gcc-ref10-i386/lib/gcc/i386-unknown-freebsd10.1/5.0.0/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-c' '-mtune=generic' '-march=i486'

When I build with just --disable-libgcj, the bootstrap also succeeds.

It is when I build without this that bootstrap fails in the manner described above.
Comment 3 Jakub Jelinek 2015-01-26 17:56:31 UTC
Can you look at libffi's config.log if it is clear why the test failed then?
Comment 4 Gerald Pfeifer 2015-01-26 23:40:06 UTC
Created attachment 34584 [details]
OBJ-0126-1523/i386-unknown-freebsd10.1/libffi/config.log

I did not find the respective check, but let me attach
OBJ-0126-1523/i386-unknown-freebsd10.1/libffi/config.log
Comment 5 H.J. Lu 2015-01-27 00:28:49 UTC
configure.host has

  i?86-*-freebsd* | i?86-*-openbsd*)
        TARGET=X86_FREEBSD; TARGETDIR=x86
        ;;

and configure.ac has

if test x$TARGET = xX86 || test x$TARGET = xX86_WIN32 || test x$TARGET = xX86_64; then
...

It is a mismatch.
Comment 6 H.J. Lu 2015-01-27 00:48:55 UTC
Created attachment 34585 [details]
An untested patch

Try this.
Comment 7 Jakub Jelinek 2015-01-27 08:20:54 UTC
I guess the question is why the freebsd specific code (freebsd.S etc.) has been removed, if it is really not needed anymore, or if it got due to a mistake.
Comment 8 H.J. Lu 2015-01-27 11:45:39 UTC
(In reply to Jakub Jelinek from comment #7)
> I guess the question is why the freebsd specific code (freebsd.S etc.) has
> been removed, if it is really not needed anymore, or if it got due to a
> mistake.

Richard should be able to answer this:

commit b21ec1ce783f09335c0e6c6f96ccc7e89da5a1b4
Author: Richard Henderson <rth@twiddle.net>
Date:   Wed Nov 5 10:15:25 2014 +0100

    x86: Rewrite closures
    
    Move everything into sysv.S, removing win32.S and freebsd.S.
    Handle all abis with a single ffi_closure_inner function.
    Move complexity of the raw THISCALL trampoline into assembly
    instead of the trampoline itself.
    Only push the context for the REGISTER abi; let the rest
Comment 9 Richard Henderson 2015-01-27 16:28:24 UTC
(In reply to Jakub Jelinek from comment #7)
> I guess the question is why the freebsd specific code (freebsd.S etc.) has
> been removed, if it is really not needed anymore, or if it got due to a
> mistake.

freebsd.S and win32.S were merged with sysv.S.  There were very
few differences between them.
Comment 10 Richard Henderson 2015-01-27 16:31:33 UTC
(In reply to H.J. Lu from comment #6)

That will probably break small structure return.

See

    case FFI_TYPE_STRUCT:
#ifndef X86
      /* ??? This should be a different ABI rather than an ifdef.  */
      if (cif->rtype->size == 1)
        flags = X86_RET_STRUCT_1B;
      else if (cif->rtype->size == 2)
        flags = X86_RET_STRUCT_2B;
      else if (cif->rtype->size == 4)
        flags = X86_RET_INT32;
      else if (cif->rtype->size == 8)
        flags = X86_RET_INT64;
      else
#endif
Comment 11 Richard Henderson 2015-01-28 23:25:10 UTC
Fixed in r220222.