Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 264755 - sys-devel/gcc - add option to control --enable-interwork flag
Summary: sys-devel/gcc - add option to control --enable-interwork flag
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-03 12:07 UTC by Sven
Modified: 2009-04-09 09:20 UTC (History)
0 users

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


Attachments
arm-elf.patch (arm-elf.patch,557 bytes, patch)
2009-04-09 09:20 UTC, Sven
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sven 2009-04-03 12:07:26 UTC
I've built a toolchain using crossdev --target arm-elf.

There are thumb libraries, but there doesn't seem to be any interwork support. Is there a way to enable it? If not, I would like to request a feature.

Reproducible: Always

Steps to Reproduce:
crossdev --stage4 --without-headers --target arm-elf \
  --stable --libc "[latest]"




Actual Results:  
There are:
/usr/arm-elf/lib/libc.a
/usr/arm-elf/lib/thumb/libc.a
/usr/lib/gcc/arm-elf/4.3.2/libgcc.a
/usr/lib/gcc/arm-elf/4.3.2/thumb/libgcc.a

But these are missing:
/usr/arm-elf/lib/interwork/libc.a
/usr/lib/gcc/arm-elf/4.3.2/interwork/libgcc.a
Comment 1 SpanKY gentoo-dev 2009-04-08 00:02:52 UTC
crossdev supports whatever gcc does.  if gcc doesnt support it, then there's nothing we can do about it.  you should ask on the gcc-help mailing list if interwork multilib even makes sense.  i dont think it does since interwork isnt an ABI.  it's merely a method for moving between ARM and thumb on the fly.
Comment 2 Sven 2009-04-08 07:48:31 UTC
gcc _does_ support interwork as well as newlib.

I know that, because I'm compiling an almost vanilla gcc like this:

MULTILIB_CONFIG=$SRCDIR/$GCC_DIR/gcc/config/arm/t-arm-elf

echo "

MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork
MULTILIB_DIRNAMES += normal interwork

" >> $MULTILIB_CONFIG

mkdir -p $BUILDDIR/$GCC_DIR
cd $BUILDDIR/$GCC_DIR

$SRCDIR/$GCC_DIR/configure --target=arm-elf --prefix=$PREFIX \
    --enable-interwork --enable-multilib --with-float=soft \
    --enable-languages="c" --with-newlib \
    --with-headers=$SRCDIR/$NEWLIB_DIR/newlib/libc/include \
    && make all-gcc install-gcc


newlib also supports interwork: simply pass --enable-interwork to it.


Also note: interwork is an ABI. It's an ABI that allows mixing of thumb and non-thumb code which isn't possible with the default ABI.
Comment 3 Sven 2009-04-08 07:58:38 UTC
Note, that the lines

MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork
MULTILIB_DIRNAMES += normal interwork


are already present in the original vanilla t-arm-elf file. They are just commented out for some reason that the author doesn't tell.

It seems, that they are there for being enabled on demand.
Comment 4 SpanKY gentoo-dev 2009-04-08 08:24:59 UTC
again, has nothing to do with crossdev.  you can simply emerge gcc with EXTRA_ECONF=--enable-interwork.
Comment 5 Sven 2009-04-08 08:45:35 UTC
(In reply to comment #4)
> again, has nothing to do with crossdev.  you can simply emerge gcc with
> EXTRA_ECONF=--enable-interwork.

That doesn't work unless the t-arm-elf is patched.
(just tried it)
Comment 6 Sven 2009-04-08 14:08:16 UTC
Is there a way of including custom patches in the build?
Something like EXTRA_ECONF, but for patches?

I guess, then this bug could be considered fixed.
Comment 7 SpanKY gentoo-dev 2009-04-09 00:21:34 UTC
we cant support things that arent available in gcc.  you can file a bug with gcc.gnu.org to get them to fix things.

gcc supports arbitrary patches in /etc/portage/patches/$CATEGORY/$PN/
Comment 8 Sven 2009-04-09 09:20:31 UTC
Created attachment 187769 [details, diff]
arm-elf.patch

I've put the patch attached to /etc/portage/patches/cross-arm-elf/gcc/arm-elf.patch and I have used EXTRA_ECONF="--enable-interwork --enable-multilib". Now I have a interwork enabled gcc.