Help!

Gentoo: How to stop emerge from overwriting gcc and gas wr..

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> General Discussions RSS
Next:  Bug#512948: Unclear which kernel version does btr..  
Author Message
Mark Hobley
External


Since: Jan 14, 2009
Posts: 28



PostPosted: Sun Jan 25, 2009 10:10 am    Post subject: Gentoo: How to stop emerge from overwriting gcc and gas wrappers
Archived from groups: alt>os>linux>gentoo, others (more info?)

I am using Gentoo. I have created a couple of wrapper scripts to force
parameters into the assembler and compiler as follows:

/usr/bin/gcc:

#!/bin/sh
gcc.real -march=i386 -Wa,-march=i386 $@

I did a similar thing with /usr/bin/as

The original compiler and assembler have been renamed as follows:

/usr/bin/gcc.real
/usr/bin/as.real

I want to: emerge -av1 binutils gcc glibc

How do I prevent cause the updated compiler and assembler to overwrite
the renamed targets gcc.real and as.real, rather than the wrapper
scripts?

--
Mark Hobley
Linux User: #370818 http://markhobley.yi.org/
Back to top
Dan Espen
External


Since: Jan 16, 2006
Posts: 496



PostPosted: Sun Jan 25, 2009 1:10 pm    Post subject: Re: Gentoo: How to stop emerge from overwriting gcc and gas [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

markhobley.RemoveThis@hotpop.donottypethisbit.com (Mark Hobley) writes:

> I am using Gentoo. I have created a couple of wrapper scripts to force
> parameters into the assembler and compiler as follows:
>
> /usr/bin/gcc:
>
> #!/bin/sh
> gcc.real -march=i386 -Wa,-march=i386 $@
>
> I did a similar thing with /usr/bin/as
>
> The original compiler and assembler have been renamed as follows:
>
> /usr/bin/gcc.real
> /usr/bin/as.real
>
> I want to: emerge -av1 binutils gcc glibc
>
> How do I prevent cause the updated compiler and assembler to overwrite
> the renamed targets gcc.real and as.real, rather than the wrapper
> scripts?

Don't start messing around with things in /usr/bin/.

The normal way to supply compiler args is thru CFLAGS, but
if you insist, put your gcc script in ~/bin and invoke the compiler
using it's full path from your script.
Back to top
J.O. Aho
External


Since: Mar 26, 2004
Posts: 2216



PostPosted: Sun Jan 25, 2009 1:10 pm    Post subject: Re: Gentoo: How to stop emerge from overwriting gcc and gas wrappers [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Mark Hobley wrote:
> I am using Gentoo. I have created a couple of wrapper scripts to force
> parameters into the assembler and compiler as follows:
>
> /usr/bin/gcc:
>
> #!/bin/sh
> gcc.real -march=i386 -Wa,-march=i386 $@

You have the CFLAGS in /etc/make.conf for this and if you are too old to
remember that when you compile something without the usage of emerge, I would
suggest you used and alias in your shell.


> I did a similar thing with /usr/bin/as
>
> The original compiler and assembler have been renamed as follows:
>
> /usr/bin/gcc.real
> /usr/bin/as.real
>
> I want to: emerge -av1 binutils gcc glibc
>
> How do I prevent cause the updated compiler and assembler to overwrite
> the renamed targets gcc.real and as.real, rather than the wrapper
> scripts?

You would need to modify your ebuild, so it attaches a exec prefix to the
filenames.

I doubt you are doing things in a good way, you seem to try to break
everything possible in Gentoo for you don't want to do it the "Gentoo way".


--

//Aho
Back to top
Nikos Chantziaras
External


Since: Aug 22, 2005
Posts: 274



PostPosted: Sun Jan 25, 2009 2:10 pm    Post subject: Re: Gentoo: How to stop emerge from overwriting gcc and gas wrappers [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Mark Hobley wrote:
> I am using Gentoo. I have created a couple of wrapper scripts to force
> parameters into the assembler and compiler as follows:
>
> /usr/bin/gcc:
>
> #!/bin/sh
> gcc.real -march=i386 -Wa,-march=i386 $@
>
> I did a similar thing with /usr/bin/as
>
> The original compiler and assembler have been renamed as follows:
>
> /usr/bin/gcc.real
> /usr/bin/as.real
>
> I want to: emerge -av1 binutils gcc glibc
>
> How do I prevent cause the updated compiler and assembler to overwrite
> the renamed targets gcc.real and as.real, rather than the wrapper
> scripts?

You don't create scripts. You leave everything as-is and put those
options in /etc/make.conf. CFLAGS, CXXFLAGS and LDFLAGS. If you want
this for manual builds too (as opposed to builds initiated by portage),
use /usr/local/bin instead of /usr/bin.
Back to top
Mark Hobley
External


Since: Jan 14, 2009
Posts: 28



PostPosted: Sun Jan 25, 2009 3:10 pm    Post subject: Re: Gentoo: Fighting the package management system [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In comp.os.linux.misc J.O. Aho <user RemoveThis @example.net> wrote:
> I doubt you are doing things in a good way, you seem to try to break
> everything possible in Gentoo for you don't want to do it the "Gentoo way".

Yeah. Some packages I want to handle outside of the Gentoo package
management system. Some packages that I am using are different versions
to what Gentoo has, and some packages have been locally modified (including
the kernel).

I want kernel, kernel headers, compiler and assembler all replaced with
ones from locally hosted sources.

The package management system seems to be fighting me every step of the
way at the moment with this.

Mark.

--
Mark Hobley
Linux User: #370818 http://markhobley.yi.org/
Back to top
Graham Murray
External


Since: Sep 13, 2004
Posts: 36



PostPosted: Sun Jan 25, 2009 4:10 pm    Post subject: Re: Gentoo: Fighting the package management system [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

markhobley DeleteThis @hotpop.donottypethisbit.com (Mark Hobley) writes:

> I want kernel, kernel headers, compiler and assembler all replaced with
> ones from locally hosted sources.
>
> The package management system seems to be fighting me every step of the
> way at the moment with this.

Create an overlay (eg in /usr/portage/local) and create ebuilds in it
for the packages you wish to control locally. If you are skilled enough
to locally install packages locally from source then creating ebuilds
(hint: copy the ebuilds from the official tree and make changes) for
your overlay should not be too difficult.
Back to top
Mark Hobley
External


Since: Jan 14, 2009
Posts: 28



PostPosted: Sun Jan 25, 2009 5:10 pm    Post subject: Re: Gentoo: How to stop emerge from overwriting gcc and gas wrappers [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In alt.os.linux.gentoo Nikos Chantziaras <realnc RemoveThis @arcor.de> wrote:
> You don't create scripts. You leave everything as-is and put those
> options in /etc/make.conf. CFLAGS, CXXFLAGS and LDFLAGS.

Yeah. I have set those. The scripts were just really to be sure that the
options are always used. Some manually installed packages may call the
compiler or assembler directly without checking /etc/make.conf.

Mark.

--
Mark Hobley
Linux User: #370818 http://markhobley.yi.org/
Back to top
Mark Hobley
External


Since: Jan 14, 2009
Posts: 28



PostPosted: Mon Jan 26, 2009 12:10 am    Post subject: Re: Gentoo: How to stop emerge from overwriting gcc and gas wrappers [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In comp.os.linux.misc Mark Hobley <markhobley RemoveThis @hotpop.donottypethisbit.com> wrote:
> Yeah. I have set those. The scripts were just really to be sure that the
> options are always used. Some manually installed packages may call the
> compiler or assembler directly without checking /etc/make.conf.

This is happening actually. I am trying to build binutils from the
source tarball and it is bypassing the scripts and calling the compiler
with the wrong build arch.

Mark.

--
Mark Hobley
Linux User: #370818 http://markhobley.yi.org/
Back to top
J.O. Aho
External


Since: Mar 26, 2004
Posts: 2216



PostPosted: Mon Jan 26, 2009 5:10 am    Post subject: Re: Gentoo: Fighting the package management system [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Mark Hobley wrote:
> In comp.os.linux.misc J.O. Aho <user.DeleteThis@example.net> wrote:
>> I doubt you are doing things in a good way, you seem to try to break
>> everything possible in Gentoo for you don't want to do it the "Gentoo way".
>
> Yeah. Some packages I want to handle outside of the Gentoo package
> management system. Some packages that I am using are different versions
> to what Gentoo has, and some packages have been locally modified (including
> the kernel).
>
> I want kernel, kernel headers, compiler and assembler all replaced with
> ones from locally hosted sources.
>
> The package management system seems to be fighting me every step of the
> way at the moment with this.

I would say it's the completely the other way around, as the portage gives you
the possibility to do all this, as long as you follow some simple rules.

Overlays been there for those who want to modify and run things different from
what the official portage includes. You have layman (in case you wanted to be
more experimental), which is a big collection of different overlays.

http://www.gentoo.org/proj/en/overlays/userguide.xml
http://www.gentoo.org/proj/en/overlays/devguide.xml

People who do want to handle packages outside the package management system
and those packages are part of the official package system are just asking for
trouble, no matter which package system they use, don't be so stubborn and
think you can't use the package system to your own advantage.

I still recommend to build your kernel less modular and use the default rc
scripts, you will save yourself trouble... you don't save on making unix
sockets to a module, nor do you save anything if you always use ext3 and have
that as a module, if you could build in everything you need at boot up time,
you could save some on the memory imprint dropping the initrd support.

--

//Aho
Back to top
J.O. Aho
External


Since: Mar 26, 2004
Posts: 2216



PostPosted: Mon Jan 26, 2009 5:10 am    Post subject: Re: Gentoo: How to stop emerge from overwriting gcc and gas wrappers [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Mark Hobley wrote:
> In comp.os.linux.misc Mark Hobley <markhobley RemoveThis @hotpop.donottypethisbit.com> wrote:
>> Yeah. I have set those. The scripts were just really to be sure that the
>> options are always used. Some manually installed packages may call the
>> compiler or assembler directly without checking /etc/make.conf.
>
> This is happening actually. I am trying to build binutils from the
> source tarball and it is bypassing the scripts and calling the compiler
> with the wrong build arch.

If you had made an overlay with your own ebuild, it all had been fixed without
any problem and you get the advantage of easy checking files, updating without
finding the old makefile and so on.


--

//Aho
Back to top
Mark Hobley
External


Since: Jan 14, 2009
Posts: 28



PostPosted: Mon Jan 26, 2009 7:10 am    Post subject: Re: Gentoo: How to stop emerge from overwriting gcc and gas wrappers [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In alt.os.linux.gentoo J.O. Aho <user.TakeThisOut@example.net> wrote:
> If you had made an overlay with your own ebuild, it all had been fixed without
> any problem and you get the advantage of easy checking files, updating without
> finding the old makefile and so on.

Yeah. I could really do with an ebuild generator.

My sources are all in standard .tar.gz format, and they mostly use the
standard mechanism:

../configure
make
make install

Mark.

--
Mark Hobley
Linux User: #370818 http://markhobley.yi.org/
Back to top
Mark Hobley
External


Since: Jan 14, 2009
Posts: 28



PostPosted: Mon Jan 26, 2009 7:10 am    Post subject: Re: Gentoo: Is there a tool to convert .tar.gz files to .ebuild? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In alt.os.linux.gentoo J.O. Aho <user.RemoveThis@example.net> wrote:

> People who do want to handle packages outside the package management system
> and those packages are part of the official package system are just asking for
> trouble, no matter which package system they use, don't be so stubborn and
> think you can't use the package system to your own advantage.

My source tarballs are all in .tar.gz format. Is there a tool to convert these
to .ebuild format?

Mark.

--
Mark Hobley
Linux User: #370818 http://markhobley.yi.org/
Back to top
Mark Hobley
External


Since: Jan 14, 2009
Posts: 28



PostPosted: Mon Jan 26, 2009 7:10 am    Post subject: Re: Gentoo: Fighting the package management system [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In alt.os.linux.gentoo J.O. Aho <user DeleteThis @example.net> wrote:

> I still recommend to build your kernel less modular and use the default rc
> scripts, you will save yourself trouble.

I will eventually be moving away from Gentoo, to another source building
method. That kernel is built for a custom distro that I am working on.

The expected migration path is:

Debian --> Gentoo --> T2 --> Custom Distro

Mark.

--
Mark Hobley
Linux User: #370818 http://markhobley.yi.org/
Back to top
J.O. Aho
External


Since: Mar 26, 2004
Posts: 2216



PostPosted: Mon Jan 26, 2009 12:10 pm    Post subject: Re: Gentoo: Is there a tool to convert .tar.gz files to .ebuild? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Mark Hobley wrote:
> In alt.os.linux.gentoo J.O. Aho <user.RemoveThis@example.net> wrote:
>
>> People who do want to handle packages outside the package management system
>> and those packages are part of the official package system are just asking for
>> trouble, no matter which package system they use, don't be so stubborn and
>> think you can't use the package system to your own advantage.
>
> My source tarballs are all in .tar.gz format. Is there a tool to convert these
> to .ebuild format?

The tarball isn't converted to any other format, it's still an tarball, the
ebuild file is just a instruction how to download, unpack, patch, compile and
install the binaries.

http://www.gentoo.org/proj/en/devrel/handbook/handbook.xml?part=2&chap=1



> > I still recommend to build your kernel less modular and use the default rc
> > scripts, you will save yourself trouble.

> I will eventually be moving away from Gentoo, to another source building
> method. That kernel is built for a custom distro that I am working on.

> The expected migration path is:

> Debian --> Gentoo --> T2 --> Custom Distro

Even if you migrate to another distribution, I do recommend you build in those
basic things into your kernel instead of having to make unconventional rc
scripts to load something you really need in early system boot. Today
modulation don't give as much advantages as it used to, as the old kernel size
limit isn't there anymore.

--

//Aho
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> General Discussions All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can 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