🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: gmane.comp.gcc.bugs
14 messages
14 total messages Started by "joel at gcc dot Mon, 24 Jan 2011 17:55
[Bug libffi/47442] New: does not build multilib on m68k
#307654
Author: "joel at gcc dot
Date: Mon, 24 Jan 2011 17:55
43 lines
2208 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idG442

           Summary: does not build multilib on m68k
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libffi
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: joel@gcc.gnu.org


I am trying to build Go to target m68k-rtems.  This target builds multilib with
many variations.  There are multiple instructions in libffi/src/m68k/sysv.S
which are not supported in all CPU models.  The build currently fails for
"-m68000" as the CPU model.

/users/joel/test-gcc/gcc-svn/libffi/src/m68k/sysv.S:88: Error: operands
mismatch -- statement `tst.l %a1' ignored
/users/joel/test-gcc/gcc-svn/libffi/src/m68k/sysv.S:106: Error: invalid
instruction for this architecture; needs 68020 [68k, 68ec020], 68030 [68ec030],
68040 [68ec040], 68060 [68ec060], cpu32 [68330, 68331, 68332, 68333, 68334,
68336, 68340, 68341, 68349, 68360], 547x [5470, 5471, 5472, 5473, 5474, 5475],
548x [5480, 5481, 5482, 5483, 5484, 5485] -- statement `fmove.s %fp0,(%a1)'
ignored
/users/joel/test-gcc/gcc-svn/libffi/src/m68k/sysv.S:112: Error: invalid
instruction for this architecture; needs 68020 [68k, 68ec020], 68030 [68ec030],
68040 [68ec040], 68060 [68ec060], cpu32 [68330, 68331, 68332, 68333, 68334,
68336, 68340, 68341, 68349, 68360], 547x [5470, 5471, 5472, 5473, 5474, 5475],
548x [5480, 5481, 5482, 5483, 5484, 5485] -- statement `fmove.d %fp0,(%a1)'
ignored
/users/joel/test-gcc/gcc-svn/libffi/src/m68k/sysv.S:118: Error: invalid
instruction for this architecture; needs M68K fpu (68020 [68k, 68ec020], 68030
[68ec030], 68040 [68ec040], 68060 [68ec060], cpu32 [68330, 68331, 68332, 68333,
68334, 68336, 68340, 68341, 68349, 68360]) -- statement `fmove.x %fp0,(%a1)'
ignored
/users/joel/test-gcc/gcc-svn/libffi/src/m68k/sysv.S:181: Error: invalid
instruction for this architecture; needs 68020 [68k, 68ec020], 68030 [68ec030],
68040 [68ec040], 68060 [68ec060], cpu32 [68330, 68331, 68332, 68333, 68334,
68336, 68340, 68341, 68349, 68360], 547x [5470, 5471, 5472, 5473, 5474, 5475],
548x [5480, 5481, 5482, 5483, 5484, 5485] -- statement `fmove.s (%a0),%fp0'
ignored
[Bug libffi/47442] does not build multilib on m68k
#307679
Author: "joel at gcc dot
Date: Mon, 24 Jan 2011 21:06
18 lines
836 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idG442

--- Comment #1 from Joel Sherrill <joel at gcc dot gnu.org> 2011-01-24 21:06:15 UTC ---
Created attachment 23108
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id#108
Hacks to disable problem areas

This patch is a hack to conditionally disable the parts of the code which cause
issues in various multilib configurations.  I see a few general areas:

+ mc68000 does not appear to be able to tst.l an address register
+ presence of FPU -- probably need to have conditionally selected alternative
for when soft FP is in use
+ At least one Coldfire (5206) does not appear to have long double so the
switch statement for all the return types in ffi.c has a duplicate case error.
I think my fix is adequate for this.

For the assembly file, I am unsure as to how to properly fix them.
[Bug libffi/47442] does not build multilib on m68k
#307688
Author: "schwab@linux-m6
Date: Mon, 24 Jan 2011 21:36
5 lines
290 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idG442

--- Comment #2 from Andreas Schwab <schwab@linux-m68k.org> 2011-01-24 21:36:52 UTC ---
This is the wrong way to fix that.  The m68k SYSV ABI requires 68020+ w/
68881/2.  If you use a different ABI you should write a proper implementation.
[Bug libffi/47442] does not build multilib on m68k
#307692
Author: "joel at gcc dot
Date: Mon, 24 Jan 2011 21:53
10 lines
480 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idG442

--- Comment #3 from Joel Sherrill <joel at gcc dot gnu.org> 2011-01-24 21:53:28 UTC ---
I didn't intend to disable them permanently.  Just identify them to implement
alternatives.

If the sysv abi cannot be used on 68000, 680x0 w/o HW FP, or at least some
Coldfire, then what is the alternative ABI?  GCC has rules on the ABI on those
targets.  Is it radically different or just slightly modified to accommodate
the differences?
[Bug libffi/47442] does not build multilib on m68k
#307729
Author: "ian at airs dot
Date: Tue, 25 Jan 2011 06:19
12 lines
578 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idG442

Ian Lance Taylor <ian at airs dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ian at airs dot com

--- Comment #4 from Ian Lance Taylor <ian at airs dot com> 2011-01-25 06:18:47 UTC ---
The alternative ABI is just slightly different.  When using the 68881, floating
point values are returned in %fp0.  When not using it, floating point values
are returned in %d0 or %d0/%d1.
[Bug libffi/47442] does not build multilib on m68k
#307856
Author: "joel at gcc dot
Date: Tue, 25 Jan 2011 18:16
17 lines
643 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idG442

--- Comment #5 from Joel Sherrill <joel at gcc dot gnu.org> 2011-01-25 18:15:41 UTC ---
(In reply to comment #4)
> The alternative ABI is just slightly different.  When using the 68881, floating
> point values are returned in %fp0.  When not using it, floating point values
> are returned in %d0 or %d0/%d1.

I think I have implemented single and double precision soft float support.
How is extended float returned?

#if defined(__MC68681__)
    fmove.x    %fp0,(%a1)
#endif

The only other issue in sysv.S is using tst.l %aX which is not supported on a
mc68000.  I just used a cmp.l %aX,#0.
[Bug libffi/47442] does not build multilib on m68k
#307860
Author: "joel at gcc dot
Date: Tue, 25 Jan 2011 18:47
26 lines
964 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idG442

Joel Sherrill <joel at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #23108|0                           |1
        is obsolete|                            |

--- Comment #6 from Joel Sherrill <joel at gcc dot gnu.org> 2011-01-25 18:47:36 UTC ---
Created attachment 23123
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id#123
Second try at multilib and m68k-*-rtems* support

There aren't a lot of changes to compile for all variants.  I have taken a shot
at the changes. The issues are:

+ tst.l %aX not supported on mc68000
+ soft float changes the returns from %fpX to %d0, %d0/%d1, or (I think)
%d0-%d2
+ Coldfire 5206 does NOT have long double.

The other change is to not use the syscall in ffi.c.  It conditionally now
supports the RTEMS Cache API.

How does this patch look?
[Bug libffi/47442] does not build multilib on m68k
#307864
Author: "ian at airs dot
Date: Tue, 25 Jan 2011 19:18
10 lines
426 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idG442

--- Comment #7 from Ian Lance Taylor <ian at airs dot com> 2011-01-25 19:17:49 UTC ---
The patch looks reasonable to me, though I would like to hear Andreas's
opinion.

Technically this patch should go to the libffi maintainers, as libffi is
maintained in a separate repository.  According to
http://sourceware.org/libffi/ the right address is
libffi-discuss@sourceware.org.
[Bug libffi/47442] does not build multilib on m68k
#307872
Author: "schwab@linux-m6
Date: Tue, 25 Jan 2011 20:06
41 lines
781 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47442

--- Comment #8 from Andreas Schwab <schwab@linux-m68k.org> 2011-01-25 20:05:54 UTC ---
>+#ifdef __rtems__
>+void rtems_cache_flush_multiple_data_lines( const void *, size_t );
>+#else

Include the header that declares it.

>+	cmp.l	#0, %a1

        cmp.w    #0, %a1

>+	move.l	%d0,(%a1)
>+	move.l	%d1,4(%a1)

    move.l    %d0,(%a1)+
    move.l    %d1,(%a1)

>+	move.l	%d0,(%a1)
>+	move.l	%d1,4(%a1)
>+	move.l	%d2,8(%a1)

    move.l    %d0,(%a1)+
    move.l    %d1,(%a1)+
    move.l    %d2,(%a1)

>+	move.l	(%a0),%d0
>+	move.l	4(%a0),%d1

    move.l    (%a0)+,%d0
    move.l    (%a0),%d1

>+	move.l	(%a0),%d0
>+	move.l	4(%a0),%d1
>+	move.l	8(%a0),%d2

    move.l    (%a0)+,%d0
    move.l    (%a0)+,%d1
    move.l    (%a0),%d2
[Bug libffi/47442] does not build multilib on m68k
#307875
Author: "joel.sherrill a
Date: Tue, 25 Jan 2011 20:34
44 lines
1116 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47442

--- Comment #9 from joel.sherrill at oarcorp dot com 2011-01-25 20:34:03 UTC ---
On 01/25/2011 02:06 PM, schwab@linux-m68k.org wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47442
>
> --- Comment #8 from Andreas Schwab<schwab@linux-m68k.org>  2011-01-25 20:05:54 UTC ---
>> +#ifdef __rtems__
>> +void rtems_cache_flush_multiple_data_lines( const void *, size_t );
>> +#else
> Include the header that declares it.
>
It isn't available when this library is built.

OK on the other suggestions.
>> +	cmp.l	#0, %a1
>          cmp.w    #0, %a1
>
>> +	move.l	%d0,(%a1)
>> +	move.l	%d1,4(%a1)
>      move.l    %d0,(%a1)+
>      move.l    %d1,(%a1)
>
>> +	move.l	%d0,(%a1)
>> +	move.l	%d1,4(%a1)
>> +	move.l	%d2,8(%a1)
>      move.l    %d0,(%a1)+
>      move.l    %d1,(%a1)+
>      move.l    %d2,(%a1)
>
>> +	move.l	(%a0),%d0
>> +	move.l	4(%a0),%d1
>      move.l    (%a0)+,%d0
>      move.l    (%a0),%d1
>
>> +	move.l	(%a0),%d0
>> +	move.l	4(%a0),%d1
>> +	move.l	8(%a0),%d2
>      move.l    (%a0)+,%d0
>      move.l    (%a0)+,%d1
>      move.l    (%a0),%d2
>
[Bug libffi/47442] does not build multilib on m68k
#307876
Author: "joel at gcc dot
Date: Tue, 25 Jan 2011 20:42
19 lines
414 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47442

--- Comment #10 from Joel Sherrill <joel at gcc dot gnu.org> 2011-01-25 20:42:19 UTC ---
(In reply to comment #8)
> >+#ifdef __rtems__
> >+void rtems_cache_flush_multiple_data_lines( const void *, size_t );
> >+#else
> 
> Include the header that declares it.
> 
> >+	cmp.l	#0, %a1
> 
>         cmp.w    #0, %a1
> 

Why cmp.w when it is tst.l?

--joel
[Bug libffi/47442] does not build multilib on m68k
#307878
Author: "schwab@linux-m6
Date: Tue, 25 Jan 2011 20:54
8 lines
255 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idG442

--- Comment #11 from Andreas Schwab <schwab@linux-m68k.org> 2011-01-25 20:53:37 UTC ---
"joel at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> writes:

> Why cmp.w when it is tst.l?

Because it is smaller.
[Bug libffi/47442] does not build multilib on m68k
#307879
Author: "joel at gcc dot
Date: Tue, 25 Jan 2011 20:58
15 lines
588 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idG442

Joel Sherrill <joel at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #23123|0                           |1
        is obsolete|                            |

--- Comment #12 from Joel Sherrill <joel at gcc dot gnu.org> 2011-01-25 20:58:37 UTC ---
Created attachment 23125
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id#125
Third try at multilib and m68k-rtems* support

This should address the comments.
Re: [Bug libffi/47442] does not build multilib on m68k
#307877
Author: Andreas Schwab
Date: Tue, 25 Jan 2011 21:53
5 lines
116 bytes
"joel at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> writes:

> Why cmp.w when it is tst.l?

Because it is smaller.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads