[HEADS UP] ar(1) front-end committed. (notes for cross compile)

classic Classic list List threaded Threaded
61 messages Options
1234
Reply | Threaded
Open this post in threaded view
|

[HEADS UP] ar(1) front-end committed. (notes for cross compile)

Kai Wang
Hello list,

I just committed ar(1) front-end. Note that you NEED update your
world before you can successfully perform cross platform buildworld.

You can update your system by:
make buildworld
...
make installworld

or you can just install ar(1) by hand.
(replace /usr/bin/ar and /usr/bin/ranlib by hand)

This is needed because GNU Binutils ar and ranlib gets renamed to gar
and granlib, and when you perform a cross platform buildworld, the
build system will instead use /usr/bin/ar and /usr/bin/ranlib, which
is not capable of cross build.

Best Regards,
Kai

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: [HEADS UP] ar(1) front-end committed. (notes for cross compile)

Kai Wang
On Thu, Feb 21, 2008 at 02:12:09PM +0100, Kai Wang wrote:

> Hello list,
>
> I just committed ar(1) front-end. Note that you NEED update your
> world before you can successfully perform cross platform buildworld.
>
> You can update your system by:
> make buildworld
> ...
> make installworld
>
> or you can just install ar(1) by hand.
> (replace /usr/bin/ar and /usr/bin/ranlib by hand)
>
> This is needed because GNU Binutils ar and ranlib gets renamed to gar
> and granlib, and when you perform a cross platform buildworld, the
> build system will instead use /usr/bin/ar and /usr/bin/ranlib, which
> is not capable of cross build.

I think it's neccessary to explain it a bit.  When you start
cross-platform world build, the toolchain targarting that platform
will be built first. Then the resulting cross-platform toolchain is
used to build the world for that platform. ar(1) and ranlib(1) are
part of the toolchain.

After I renamed them to gar and granlib, the build system can no
longer find them, as a result it will use default ones, i.e.,
/usr/bin/ar and /usr/bin/ranlib, which target your current platform
and thus can not be used to cross build.

You can solve this problem by updating your own world first, or by
replacing '/usr/bin/ar' and '/usr/bin/ranlib' with 'BSD' ar and ranlib
by hand. 'BSD' ar is platform independent and handles all the ELF
targets thus can be used directly (no need to recompile itself for
target platform) by the build system.

Best Regards,
Kai

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: [HEADS UP] ar(1) front-end committed. (notes for cross compile)

Konstantin Belousov
On Thu, Feb 21, 2008 at 03:02:47PM +0100, Kai Wang wrote:

> On Thu, Feb 21, 2008 at 02:12:09PM +0100, Kai Wang wrote:
> > Hello list,
> >
> > I just committed ar(1) front-end. Note that you NEED update your
> > world before you can successfully perform cross platform buildworld.
> >
> > You can update your system by:
> > make buildworld
> > ...
> > make installworld
> >
> > or you can just install ar(1) by hand.
> > (replace /usr/bin/ar and /usr/bin/ranlib by hand)
> >
> > This is needed because GNU Binutils ar and ranlib gets renamed to gar
> > and granlib, and when you perform a cross platform buildworld, the
> > build system will instead use /usr/bin/ar and /usr/bin/ranlib, which
> > is not capable of cross build.
>
> I think it's neccessary to explain it a bit.  When you start
> cross-platform world build, the toolchain targarting that platform
> will be built first. Then the resulting cross-platform toolchain is
> used to build the world for that platform. ar(1) and ranlib(1) are
> part of the toolchain.
>
> After I renamed them to gar and granlib, the build system can no
> longer find them, as a result it will use default ones, i.e.,
> /usr/bin/ar and /usr/bin/ranlib, which target your current platform
> and thus can not be used to cross build.
>
> You can solve this problem by updating your own world first, or by
> replacing '/usr/bin/ar' and '/usr/bin/ranlib' with 'BSD' ar and ranlib
> by hand. 'BSD' ar is platform independent and handles all the ELF
> targets thus can be used directly (no need to recompile itself for
> target platform) by the build system.
Shall the crossbuild for CURRENT work on RELENG_[67] ? If not, this is a
huge regression.

attachment0 (202 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [HEADS UP] ar(1) front-end committed. (notes for cross compile)

Ivan Voras
Kostik Belousov wrote:

> Shall the crossbuild for CURRENT work on RELENG_[67] ? If not, this is a
> huge regression.

Why wouldn't it, unless you're building amd64 CURRENT on i386
RELENG_[67] or a similar combination?


signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [HEADS UP] ar(1) front-end committed. (notes for cross compile)

Ruslan Ermilov
In reply to this post by Kai Wang
On Thu, Feb 21, 2008 at 03:02:47PM +0100, Kai Wang wrote:

> On Thu, Feb 21, 2008 at 02:12:09PM +0100, Kai Wang wrote:
> > Hello list,
> >
> > I just committed ar(1) front-end. Note that you NEED update your
> > world before you can successfully perform cross platform buildworld.
> >
> > You can update your system by:
> > make buildworld
> > ...
> > make installworld
> >
> > or you can just install ar(1) by hand.
> > (replace /usr/bin/ar and /usr/bin/ranlib by hand)
> >
> > This is needed because GNU Binutils ar and ranlib gets renamed to gar
> > and granlib, and when you perform a cross platform buildworld, the
> > build system will instead use /usr/bin/ar and /usr/bin/ranlib, which
> > is not capable of cross build.
>
> I think it's neccessary to explain it a bit.  When you start
> cross-platform world build, the toolchain targarting that platform
> will be built first. Then the resulting cross-platform toolchain is
> used to build the world for that platform. ar(1) and ranlib(1) are
> part of the toolchain.
>
> After I renamed them to gar and granlib, the build system can no
> longer find them, as a result it will use default ones, i.e.,
> /usr/bin/ar and /usr/bin/ranlib, which target your current platform
> and thus can not be used to cross build.
>
> You can solve this problem by updating your own world first, or by
> replacing '/usr/bin/ar' and '/usr/bin/ranlib' with 'BSD' ar and ranlib
> by hand. 'BSD' ar is platform independent and handles all the ELF
> targets thus can be used directly (no need to recompile itself for
> target platform) by the build system.
>
If BSD ar(1) is crossplatform-neutral, you just need to add it
to bootstrap-tools, like this:

: Index: Makefile.inc1
: ===================================================================
: RCS file: /home/ncvs/src/Makefile.inc1,v
: retrieving revision 1.598
: diff -u -p -r1.598 Makefile.inc1
: --- Makefile.inc1 5 Feb 2008 15:41:58 -0000 1.598
: +++ Makefile.inc1 21 Feb 2008 15:11:07 -0000
: @@ -885,8 +885,13 @@ _crunchgen= usr.sbin/crunch/crunchgen
:  _mklocale= usr.bin/mklocale
:  .endif
:  
: +.if ${BOOTSTRAPPING} < 800022
: +_ar= usr.bin/ar
: +.endif
: +
:  bootstrap-tools:
:  .for _tool in \
: +    ${_ar} \
:      ${_mklocale} \
:      ${_strfile} \
:      ${_gperf} \

Then the breakage will be gone.

With this change, we also bump the minimum requirement for source
upgrades from 6.0-RELEASE to "7.0-CURRENT at some point" because
new ar(1) requires libelf which is not available in previous
releases of FreeBSD.


Cheers,
--
Ruslan Ermilov
[hidden email]
FreeBSD committer
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: [HEADS UP] ar(1) front-end committed. (notes for cross compile)

Konstantin Belousov
In reply to this post by Ivan Voras
On Thu, Feb 21, 2008 at 04:16:24PM +0100, Ivan Voras wrote:
> Kostik Belousov wrote:
>
> > Shall the crossbuild for CURRENT work on RELENG_[67] ? If not, this is a
> > huge regression.
>
> Why wouldn't it, unless you're building amd64 CURRENT on i386
> RELENG_[67] or a similar combination?
>
Exactly.


attachment0 (202 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [HEADS UP] ar(1) front-end committed. (notes for cross compile)

Ruslan Ermilov
In reply to this post by Ivan Voras
On Thu, Feb 21, 2008 at 04:16:24PM +0100, Ivan Voras wrote:
> Kostik Belousov wrote:
>
> > Shall the crossbuild for CURRENT work on RELENG_[67] ? If not, this is a
> > huge regression.
>
> Why wouldn't it, unless you're building amd64 CURRENT on i386
> RELENG_[67] or a similar combination?
>
Using host ar(1) (/usr/bin/ar) for world builds is a bug.
ar(1) needs to be either bootstrapped (if its code is
platform-neutral) or built as part of cross-tools.  That
in turn means that we won't be able to upgrade to 8.0
(when it's released) from <7.0 (libelf exists only
starting from 7.0).


Cheers,
--
Ruslan Ermilov
[hidden email]
FreeBSD committer
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: [HEADS UP] ar(1) front-end committed. (notes for cross compile)

Kai Wang
In reply to this post by Ivan Voras
On Thu, Feb 21, 2008 at 04:16:24PM +0100, Ivan Voras wrote:
> Kostik Belousov wrote:
>
> > Shall the crossbuild for CURRENT work on RELENG_[67] ? If not, this is a
> > huge regression.
>
> Why wouldn't it, unless you're building amd64 CURRENT on i386
> RELENG_[67] or a similar combination?

That's right... I didn't consider this situation before...
Building amd64 CURRENT on i386 RELENG_[67] won't work.  I'll see what
I can do, I think we probably need revert back to let Binutils ar to
handle the cross build.

My Makefile knowledge is very poor, is there a way to let the build
system use Binutils 'ar' in the building process but later install
it as 'gar'?

Thanks,
--
Kai



_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: [HEADS UP] ar(1) front-end committed. (notes for cross compile)

Konstantin Belousov
On Thu, Feb 21, 2008 at 04:30:26PM +0100, Kai Wang wrote:

> On Thu, Feb 21, 2008 at 04:16:24PM +0100, Ivan Voras wrote:
> > Kostik Belousov wrote:
> >
> > > Shall the crossbuild for CURRENT work on RELENG_[67] ? If not, this is a
> > > huge regression.
> >
> > Why wouldn't it, unless you're building amd64 CURRENT on i386
> > RELENG_[67] or a similar combination?
>
> That's right... I didn't consider this situation before...
> Building amd64 CURRENT on i386 RELENG_[67] won't work.  I'll see what
> I can do, I think we probably need revert back to let Binutils ar to
> handle the cross build.
Yes, please. This is critical for my work.

> My Makefile knowledge is very poor, is there a way to let the build
> system use Binutils 'ar' in the building process but later install
> it as 'gar'?
>
> Thanks,
> --
> Kai

attachment0 (202 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [HEADS UP] ar(1) front-end committed. (notes for cross compile)

Ivan Voras
In reply to this post by Konstantin Belousov
Kostik Belousov wrote:
> On Thu, Feb 21, 2008 at 04:16:24PM +0100, Ivan Voras wrote:
>> Kostik Belousov wrote:
>>
>>> Shall the crossbuild for CURRENT work on RELENG_[67] ? If not, this is a
>>> huge regression.
>> Why wouldn't it, unless you're building amd64 CURRENT on i386
>> RELENG_[67] or a similar combination?
>>
> Exactly.

Maybe a note like "please symlink ar to gar before attempting this kind
update" would be sufficient? Or the similar notion built into the makefile?



signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [HEADS UP] ar(1) front-end committed. (notes for cross compile)

Konstantin Belousov
On Thu, Feb 21, 2008 at 04:47:52PM +0100, Ivan Voras wrote:

> Kostik Belousov wrote:
> > On Thu, Feb 21, 2008 at 04:16:24PM +0100, Ivan Voras wrote:
> >> Kostik Belousov wrote:
> >>
> >>> Shall the crossbuild for CURRENT work on RELENG_[67] ? If not, this is a
> >>> huge regression.
> >> Why wouldn't it, unless you're building amd64 CURRENT on i386
> >> RELENG_[67] or a similar combination?
> >>
> > Exactly.
>
> Maybe a note like "please symlink ar to gar before attempting this kind
> update" would be sufficient? Or the similar notion built into the makefile?
This is not an update. Instead, this is normal and often exercised part
of the workflow.

attachment0 (202 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [HEADS UP] ar(1) front-end committed. (notes for cross compile)

Kai Wang
In reply to this post by Ruslan Ermilov
On Thu, Feb 21, 2008 at 06:16:27PM +0300, Ruslan Ermilov wrote:

> : Index: Makefile.inc1
> : ===================================================================
> : RCS file: /home/ncvs/src/Makefile.inc1,v
> : retrieving revision 1.598
> : diff -u -p -r1.598 Makefile.inc1
> : --- Makefile.inc1 5 Feb 2008 15:41:58 -0000 1.598
> : +++ Makefile.inc1 21 Feb 2008 15:11:07 -0000
> : @@ -885,8 +885,13 @@ _crunchgen= usr.sbin/crunch/crunchgen
> :  _mklocale= usr.bin/mklocale
> :  .endif
> :  
> : +.if ${BOOTSTRAPPING} < 800022
> : +_ar= usr.bin/ar
> : +.endif
> : +
> :  bootstrap-tools:
> :  .for _tool in \
> : +    ${_ar} \
> :      ${_mklocale} \
> :      ${_strfile} \
> :      ${_gperf} \
>
> Then the breakage will be gone.

Hello Ruslan,

Thanks for pointing me to the right place.

> With this change, we also bump the minimum requirement for source
> upgrades from 6.0-RELEASE to "7.0-CURRENT at some point" because
> new ar(1) requires libelf which is not available in previous
> releases of FreeBSD.

I think this requirement bump is unacceptable for now, probably
we can do this after the EOL of 6.x...

I just backed out the Makefile changes, and I plan to let 'BSD' ar
install as "bsdar", as Robert just suggested.

Thanks,
--
Kai
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: [HEADS UP] ar(1) front-end committed. (notes for cross compile)

David O'Brien
In reply to this post by Ruslan Ermilov
On Thu, Feb 21, 2008 at 06:25:49PM +0300, Ruslan Ermilov wrote:
> in turn means that we won't be able to upgrade to 8.0
> (when it's released) from <7.0 (libelf exists only
> starting from 7.0).

And many of us don't feel that is a bad limitation.
Upgrading to FreeBSD Y+2.x from Y.x is not _required_ to work.

--
-- David  ([hidden email])
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: [HEADS UP] ar(1) front-end committed. (notes for cross compile)

Peter Jeremy
In reply to this post by Ruslan Ermilov
On Thu, Feb 21, 2008 at 06:16:27PM +0300, Ruslan Ermilov wrote:
>With this change, we also bump the minimum requirement for source
>upgrades from 6.0-RELEASE to "7.0-CURRENT at some point" because
>new ar(1) requires libelf which is not available in previous
>releases of FreeBSD.

Can't libelf be added to the bootstrap toolchain if it doesn't already exist?

--
Peter Jeremy
Please excuse any delays as the result of my ISP's inability to implement
an MTA that is either RFC2821-compliant or matches their claimed behaviour.

attachment0 (194 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [HEADS UP] ar(1) front-end committed. (notes for cross compile)

Joseph Koshy
In reply to this post by Ruslan Ermilov
>  With this change, we also bump the minimum requirement for source
>  upgrades from 6.0-RELEASE to "7.0-CURRENT at some point" because
>  new ar(1) requires libelf which is not available in previous
>  releases of FreeBSD.

libelf should work fine on RELENG_6; we can merge it if needed.

Regards,
Koshy
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: [HEADS UP] ar(1) front-end committed. (notes for cross compile)

Ruslan Ermilov
In reply to this post by David O'Brien
On Thu, Feb 21, 2008 at 09:31:51AM -0800, David O'Brien wrote:
> On Thu, Feb 21, 2008 at 06:25:49PM +0300, Ruslan Ermilov wrote:
> > in turn means that we won't be able to upgrade to 8.0
> > (when it's released) from <7.0 (libelf exists only
> > starting from 7.0).
>
> And many of us don't feel that is a bad limitation.
> Upgrading to FreeBSD Y+2.x from Y.x is not _required_ to work.
>
I was just pointing out the fact, because now we have it
set to 600034.  And breaking it for no good reason makes
no sense.  I'll post a patch soon (after local testing)
that should make everyone happy.


Cheers,
--
Ruslan Ermilov
[hidden email]
FreeBSD committer
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: [HEADS UP] ar(1) front-end committed. (notes for cross compile)

Ruslan Ermilov
In reply to this post by Peter Jeremy
On Fri, Feb 22, 2008 at 05:14:26AM +1100, Peter Jeremy wrote:
> On Thu, Feb 21, 2008 at 06:16:27PM +0300, Ruslan Ermilov wrote:
> >With this change, we also bump the minimum requirement for source
> >upgrades from 6.0-RELEASE to "7.0-CURRENT at some point" because
> >new ar(1) requires libelf which is not available in previous
> >releases of FreeBSD.
>
> Can't libelf be added to the bootstrap toolchain if it doesn't already exist?
>
Theoretically yes, but then there's also libarchive, and I'm
not sure which versions of libelf/libarchive were tested to
work with BSD ar(1).  I have a different idea of how to fix
things.


Cheers,
--
Ruslan Ermilov
[hidden email]
FreeBSD committer
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: [HEADS UP] ar(1) front-end committed. (notes for cross compile)

Ruslan Ermilov
In reply to this post by Joseph Koshy
On Fri, Feb 22, 2008 at 09:35:48AM +0530, Joseph Koshy wrote:
> >  With this change, we also bump the minimum requirement for source
> >  upgrades from 6.0-RELEASE to "7.0-CURRENT at some point" because
> >  new ar(1) requires libelf which is not available in previous
> >  releases of FreeBSD.
>
> libelf should work fine on RELENG_6; we can merge it if needed.
>
I don't think it's needed.  On systems that don't have
libelf/libarchive, we can simply fall back to using GNU
ar(1) for the purposes of build.


Cheers,
--
Ruslan Ermilov
[hidden email]
FreeBSD committer
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: [HEADS UP] ar(1) front-end committed. (notes for cross compile)

Ruslan Ermilov
In reply to this post by Ruslan Ermilov
Hi,

Here's the promised patch.  What it does:

- Switch again to using BSD ar(1) by default, but provide a knob
  to use GNU ar(1) as the system ar(1).  (Option WITH_BSDAR is
  replaced with option WITH_GNUAR.)

- Install BSD ar(1) as bsdar(1) with the necessary links:
  bsdranlib(1), ar(1), and ranlib(1) (the latter two unless we
  build WITH_GNUAR).

- ar.1 moved to bsdar.1 along with some bugfixing.
 
- Don't proceed with bsdar(1) if option WITHOUT_TOOLCHAIN is set.

- Handle upgrades nicely: use GNU ar(1) during the build on older
  systems, and use BSD ar(1) on newer systems.  For now, always
  bootstrap BSD ar(1) on newer systems during the build (in case
  some bugs pop up), but after some period of testing, we can stop
  unconditionally bootstrapping it.

Please review.


Cheers,
--
Ruslan Ermilov
[hidden email]
FreeBSD committer

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: [HEADS UP] ar(1) front-end committed. (notes for cross compile)

David O'Brien
On Fri, Feb 22, 2008 at 12:16:42PM +0300, Ruslan Ermilov wrote:
> RCS file: /home/ncvs/src/usr.bin/Makefile,v
..
> - ar \
> + ${_ar} \
..
>  .if ${MK_TOOLCHAIN} != "no"
> +_ar= ar

Please commit now - I should have done it this way.


> RCS file: /home/ncvs/src/usr.bin/ar/Makefile,v
..
> -.if defined(WITH_BSDAR)
> -PROG= ar
> -.else
>  PROG= bsdar
> -.endif
> +LINKS= ${BINDIR}/bsdar ${BINDIR}/bsdranlib
> +MLINKS= bsdar.1 bsdranlib.1

LINKS and MLINKS don't belong here in a Makefile - they are better
located where I have them.


> -NO_SHARED?= yes

It looks like you're totally removing the NO_SHARED setting, or do you
still have it set when BSD-ar is the default 'ar'?
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
1234