Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Unable to Clean Crossdev Toolchains
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
R0b0t1
Apprentice
Apprentice


Joined: 05 Jun 2008
Posts: 255

PostPosted: Sat Jul 07, 2018 3:44 pm    Post subject: Unable to Clean Crossdev Toolchains Reply with quote

Hello, back when I was figuring out ARM processor feature sets I created a couple of crossdev toolchains. They remain, to this day, haunting me, and constantly failing to build. Running:
Code:
# crossdev -C armv7m-hardfloat-eabi
 * Uninstalling target 'armv7m-hardfloat-eabi' ...
<<< cross-armv7m-hardfloat-eabi/binutils-2.29.1-r1
 * Switching to armv7m-hardfloat-eabi-2.30 ...                                                                                                          [ ok ]
<<< cross-armv7m-hardfloat-eabi/binutils-2.29.1-r1
<<< cross-armv7m-hardfloat-eabi/binutils-2.29.1-r1
<<< cross-armv7m-hardfloat-eabi/binutils-2.30-r2
 * Switching to armv7m-hardfloat-eabi-2.28.1 ...                                                                                                        [ ok ]
<<< cross-armv7m-hardfloat-eabi/binutils-2.30-r2
<<< cross-armv7m-hardfloat-eabi/binutils-2.30-r2
<<< cross-armv7m-hardfloat-eabi/binutils-2.28.1
PORTAGE_BZIP2_COMMAND setting is invalid: 'bzip2'
PORTAGE_BZIP2_COMMAND setting from make.globals is invalid: 'bzip2'
<<< cross-armv7m-hardfloat-eabi/binutils-2.28.1
<<< cross-armv7m-hardfloat-eabi/binutils-2.28.1


Appears to work, but my next @world merge pulls in cross-armv7m-hardfloat-eabi/gcc-7.3.0. I've attempted to clean up the crossroots manually to no avail. Any help?
Back to top
View user's profile Send private message
hackernotcracker
n00b
n00b


Joined: 13 Aug 2018
Posts: 13
Location: Oregon, USA

PostPosted: Mon Aug 13, 2018 9:51 pm    Post subject: Re: Unable to Clean Crossdev Toolchains Reply with quote

R0b0t1 wrote:
Hello, back when I was figuring out ARM processor feature sets I created a couple of crossdev toolchains. They remain, to this day, haunting me, and constantly failing to build. Running:
Code:
# crossdev -C armv7m-hardfloat-eabi
 * Uninstalling target 'armv7m-hardfloat-eabi' ...
<<< cross-armv7m-hardfloat-eabi/binutils-2.29.1-r1
 * Switching to armv7m-hardfloat-eabi-2.30 ...                                                                                                          [ ok ]
<<< cross-armv7m-hardfloat-eabi/binutils-2.29.1-r1
<<< cross-armv7m-hardfloat-eabi/binutils-2.29.1-r1
<<< cross-armv7m-hardfloat-eabi/binutils-2.30-r2
 * Switching to armv7m-hardfloat-eabi-2.28.1 ...                                                                                                        [ ok ]
<<< cross-armv7m-hardfloat-eabi/binutils-2.30-r2
<<< cross-armv7m-hardfloat-eabi/binutils-2.30-r2
<<< cross-armv7m-hardfloat-eabi/binutils-2.28.1
PORTAGE_BZIP2_COMMAND setting is invalid: 'bzip2'
PORTAGE_BZIP2_COMMAND setting from make.globals is invalid: 'bzip2'
<<< cross-armv7m-hardfloat-eabi/binutils-2.28.1
<<< cross-armv7m-hardfloat-eabi/binutils-2.28.1


Appears to work, but my next @world merge pulls in cross-armv7m-hardfloat-eabi/gcc-7.3.0. I've attempted to clean up the crossroots manually to no avail. Any help?




Crossdev builds a pseudo-package and typically stores it in a local repository under /usr, unless you create a repsitory directory and modify /etc/portage/eselect-repo.conf.
Regardless of where the local repository is, Gentoo does not seem to clean up crossdev pseudo-packages well.
I've found that I need to remove unwanted binary links and tool directories by hand, even after I have un-merged the failed packages.
I've also found that the names of the cross tools can conflict with the default libraries the tools are compiled against. ( I intend to ask for help on compiling a library for newlib, after I answer your question).


eg: I set up a special local repository by adding has this section to /etc/portage/eselct-repo.conf:

Code:
 
[crossdev]
location = /var/db/repos/crossdev
sync-type =
sync-url =



If you don't have a section like this, then the location that psudo-package & ebuild links are in ... is likely the default place under /usr/local/portage/crossdev.
What's for certain is that the name of your tool will be in a directory under a crossdev directory that you can locate with linux 'find' command.
The pseudo-packages will also begin with the name crossdev; eg: crossdev-armv7m-...
There will be a separate directory for every variation of an arm compiler that you tried to create a tool for.
You should try to emerge --unmerge the full package names that you don't want.
This still won't clean up all the directories that were installed, but it's a start.
Then you can clean up the useless/broken pseudo-package directories by hand, by just removing them using the rm command or a file manager.

In general, since unmerging does not remove all the binaries ... you can look under /usr/ and you should find the binary directories for the tools you don't want recognizably named.
for example, you might see /usr/armv7m-hardfloat-eabi directory. All the compilers will be found under that directory. Simply unmerge the full package name emerge --unmerge cross-armv7m-hardfloat-eabi/gcc should remove gcc, but if it doesn't then rm -rf /usr/armv7m-hardfloat-eabi should remove all conflicting binaries from previous cross tools builds.

There is one other directory you need to be aware of, I think it's /usr/libexec you will fine /usr/libexec/gcc and /usr/libexec/binutils in there.
Sometimes stale hard or soft links to the /usr/arm... directory will be created in /usr/libexec and confuse gcc's autoconfig scripts when building a cross tool.
The only way to fix this is to hand remove all arm packages in those subdirectories. Be careful not to delete non arm cross tools.

Once you have made sure all traces of old binaries and links are removed, then you can use crossdev again ... to create only the arm toolchain you want.

FYI:
I'm trying to get gentoo to compile a toolchain with a four part naming convention, cross-armv6m-softfloat-eabi-newlib
This will force each cross compiler chain to also explicitly show which standard library it is linking to, and prevent two slightly incompatible gcc toolchains from over-writing each other.
eg: a toolchain default linked against newlib, vs. one default linked against glib is a typical scenario.

I'll post another thread with details, patches to gentoo ebuild scripts, etc. that might help you and others in the future build cross device toolchains,
I'm just having difficulty geting the gentoo newlib library to compile which is why I've come to the fourms.
_________________
What's the difference between a liar and a joker? A liar always claims what they said was just a joke, but a real joker just laughs.
Back to top
View user's profile Send private message
Chiitoo
Administrator
Administrator


Joined: 28 Feb 2010
Posts: 1676
Location: Here and Away Again

PostPosted: Tue Aug 14, 2018 2:07 pm    Post subject: ><)))°€ Reply with quote

To add to the above a bit:

R0b0t1 wrote:
but my next @world merge pulls in cross-armv7m-hardfloat-eabi/gcc-7.3.0

Does your 'world' file perhaps have related atoms in it still?
_________________
Kind Regards,
~ The Noob Unlimited ~

Sore wa sore, kore wa kore.
Back to top
View user's profile Send private message
hackernotcracker
n00b
n00b


Joined: 13 Aug 2018
Posts: 13
Location: Oregon, USA

PostPosted: Wed Aug 15, 2018 11:11 pm    Post subject: Reply with quote

Also, if you have "equery", you can do:

equery list "*" | grep cross-

That will list all the packages created and installed by crossdev.
Even if you hand remove the files, sometimes portage won't let you install new crossdev packages if you don't:

emerge --unmerge cross-FOO/BAR

For each toolchain cross-FOO and package BAR.
_________________
What's the difference between a liar and a joker? A liar always claims what they said was just a joke, but a real joker just laughs.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum