Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 882825 - Align to 32-bit rather than 16-bit on m68k with -malign-int
Summary: Align to 32-bit rather than 16-bit on m68k with -malign-int
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Profiles (show other bugs)
Hardware: m68k Linux
: Normal normal
Assignee: m68k team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-24 22:17 UTC by James Le Cuirot
Modified: 2024-09-23 08:23 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Le Cuirot gentoo-dev 2022-11-24 22:17:58 UTC
On m68k, we see a lot of failures, usually in tests, arising from the fact that it aligns to 16-bit, by default. It is currently impossible to build or run LLVM. Aligning to 32-bit would make it far more compatible with other architectures. Debian are planning to do the same. I gather adjustments to glibc will be required.

From the gcc man page:

       -malign-int
       -mno-align-int
           Control whether GCC aligns "int", "long", "long long", "float", "double", and "long double" variables on a 32-bit boundary (-malign-int) or a 16-bit boundary (-mno-align-int).  Aligning variables on 32-bit boundaries produces code that runs somewhat faster on processors with 32-bit busses at the expense of more memory.

           Warning: if you use the -malign-int switch, GCC aligns structures containing the above types differently than most published application binary interface specifications for the m68k.


This is followed by this paragraph, although I think it is a formatting error and it really belongs to the -mpcrel option:

           Use the pc-relative addressing mode of the 68000 directly, instead of using a global offset table.  At present, this option implies -fpic, allowing at most a 16-bit offset for pc-relative addressing.  -fPIC is not presently supported with -mpcrel, though this could be supported for 68020 and higher processors.
Comment 1 James Le Cuirot gentoo-dev 2022-12-08 21:31:51 UTC
Just a note to say I've experimented with this, and it works quite well, aside from the occasional process spinning on the CPU. My glibc changes were pure guesswork. :)
Comment 2 Andreas K. Hüttel archtester gentoo-dev 2023-08-25 15:39:11 UTC
(In reply to James Le Cuirot from comment #1)
> Just a note to say I've experimented with this, and it works quite well,
> aside from the occasional process spinning on the CPU. My glibc changes were
> pure guesswork. :)

So what's your plan here?
Comment 3 James Le Cuirot gentoo-dev 2023-08-26 09:57:33 UTC
(In reply to Andreas K. Hüttel from comment #2)
> So what's your plan here?

Finally get around sending this:

https://sourceware.org/pipermail/libc-help/2023-August/006438.html

Now I have. :)