public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] How to build kernel with old binutils?
@ 2022-10-10 16:00 Grant Edwards
  2022-10-10 17:22 ` Alan J. Wylie
  0 siblings, 1 reply; 4+ messages in thread
From: Grant Edwards @ 2022-10-10 16:00 UTC (permalink / raw
  To: gentoo-user

I regularly need to build old Linux kernels (as far back as 2.6), and
have a variety of older versions of gcc installed and a shell script
that knows what versions of gcc to use for what kernel versions. Using
an old version of GCC is simple: you just specify it on the command
line when doing the make:

  $ cd linux-3.whatever
  $ make distclean
  $ make defconfig
  $ make GCC=/usr/bin/gcc-4.3.6 modules

After some recent updates, I now get an 'ld' failure on some old
kernel buils. From what I've read it seems that I now need to also use
older binutils versions, and that's got me stumped. I've tried adding
LD=/path/to/ld to the make, but that appears to be ignored.

Can somebody give a clue how to specify the binutils to be used when
building a Linux kernel?

Thanks...

--
Grant






^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-user] How to build kernel with old binutils?
  2022-10-10 16:00 [gentoo-user] How to build kernel with old binutils? Grant Edwards
@ 2022-10-10 17:22 ` Alan J. Wylie
  2022-10-10 17:33   ` [gentoo-user] " Grant Edwards
  0 siblings, 1 reply; 4+ messages in thread
From: Alan J. Wylie @ 2022-10-10 17:22 UTC (permalink / raw
  To: Grant Edwards; +Cc: gentoo-user

Grant Edwards <grant.b.edwards@gmail.com> writes:

> Can somebody give a clue how to specify the binutils to be used when
> building a Linux kernel?

$ man binutils-config

The binutils-config script allows you to switch between different
versions of binutils when you have installed multiple copies (see
USE=multislot).  It also allows you to manage multiple cross-compiling
targets simultaneously.

$ binutils-config --list-profiles
 [1] arm-none-eabi-2.38 *
 [2] x86_64-pc-linux-gnu-2.38 *

-- 
Alan J. Wylie                                          https://www.wylie.me.uk/

Dance like no-one's watching. / Encrypt like everyone is.
Security is inversely proportional to convenience


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [gentoo-user] Re: How to build kernel with old binutils?
  2022-10-10 17:22 ` Alan J. Wylie
@ 2022-10-10 17:33   ` Grant Edwards
  2022-10-11 16:16     ` Grant Edwards
  0 siblings, 1 reply; 4+ messages in thread
From: Grant Edwards @ 2022-10-10 17:33 UTC (permalink / raw
  To: gentoo-user

On 2022-10-10, <flzdjhmtax@wylie.me.uk> (Alan J. Wylie) <flzdjhmtax@wylie.me.uk> wrote:
> Grant Edwards <grant.b.edwards@gmail.com> writes:
>
>> Can somebody give a clue how to specify the binutils to be used when
>> building a Linux kernel?
>
> $ man binutils-config
>
> The binutils-config script allows you to switch between different
> versions of binutils when you have installed multiple copies (see
> USE=multislot).  It also allows you to manage multiple cross-compiling
> targets simultaneously.

AFAICT, that changes the binutils configuraiton for the entire
system. That's not what I want to do. I want to use specific binutils
versions for specific make invocations. [Similar to the way can for
gcc with "make GCC=/usr/bin/gcc-whatever".] Is there an option I
missed that just changes the configuration only for the current shell
session?

-- 
Grant





^ permalink raw reply	[flat|nested] 4+ messages in thread

* [gentoo-user] Re: How to build kernel with old binutils?
  2022-10-10 17:33   ` [gentoo-user] " Grant Edwards
@ 2022-10-11 16:16     ` Grant Edwards
  0 siblings, 0 replies; 4+ messages in thread
From: Grant Edwards @ 2022-10-11 16:16 UTC (permalink / raw
  To: gentoo-user

On Oct 10, 2022, 12:46 PM  Alan J. Wylie wrote:
> Grant Edwards <grant.b.edwards@gmail.com> wrote:
> > On 2022-10-10, <flzdjhmtax@wylie.me.uk> (Alan J. Wylie) <flzdjhmtax@wylie.me.uk> wrote:
> >> $ man binutils-config
> >>
> >> [...]
> >
> > AFAICT, that changes the binutils configuraiton for the entire
> > system. That's not what I want to do. I want to use specific binutils
> > versions for specific make invocations. [...]

> Perhaps, pretend you're cross compiling? Perhaps you sort of are,
> anyway, even if just for other package versions on the same
> architecture?

> Might "crossdev" help?
>
> https://wiki.gentoo.org/wiki/Embedded_Handbook/General/Creating_a_cross-compiler
>
> $ crossdev --help
> Usage: crossdev [options] --target TARGET

Thanks!

That looks promising. I was somewhat aware of crossdev, but it hadn't
occured to me to use it to to generate native toolchains with various
versions of gcc/binutils. In my case, I wouldn't need any libc at all,
but that shouldn't be a big problem.

--
Grant




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-11 16:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-10 16:00 [gentoo-user] How to build kernel with old binutils? Grant Edwards
2022-10-10 17:22 ` Alan J. Wylie
2022-10-10 17:33   ` [gentoo-user] " Grant Edwards
2022-10-11 16:16     ` Grant Edwards

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox