[Call for testers] "BSD ar"

classic Classic list List threaded Threaded
29 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[Call for testers] "BSD ar"

Kai Wang
Hi list,

I think it's time for "BSD ar" to get a public review after months of
bug hunting and cleaning up done by jkoshy@ and me.  The majority of
the coding work was done during the summer of 2007 and was sponsored
by Google SoC 2007 programme.

You can find the tarball at:
http://web.student.chalmers.se/~kaiw/patch/ar-20080111.tgz

BSD ar is mostly compatible with GNU ar and it has advantages like:

* BSD licensed.
* hopefully cleaner and simpler. (build on libarchive and libelf)
* inherited compression support from libarchive.
  (the usefulness of this function is limited though, since ld(1)
   does not recognize compressed .a files)
* faster, due to the adoption of libarchive and libelf.
  (see benchmark below)

Some details on the speedup brought by BSD ar:

Below is a speed comparison of processing 5329 .o files (38 MB in
total) in create, list and extract mode of both ar. The benchmark was
done by the acp.sh script (you can find it in the tarball) which was
adapted from Jan Psota's Tar Comparison Program.

        outcast% sh acp.sh ~/arobj .
        bsdar:  BSD ar 1.0.0 - libarchive 2.4.10
        gnuar:  GNU ar 2.15 [FreeBSD] 2004-05-23

        best time of 3 repetitions
                src=/home/kaiw/arobj, 38M in     5329 files
                archive=./acp.a, extract to ./acptmp

        program operation       real    user    system     speed
        bsdar   create          2.17    0.26    0.68     15741 KB/s
        gnuar   create          8.80    5.30    2.89      3881 KB/s

        bsdar   list            0.04    0.00    0.04    854000 KB/s
        gnuar   list            0.70    0.51    0.18     48800 KB/s

        bsdar   extract         4.10    0.02    1.22      8331 KB/s
        gnuar   extract         4.95    0.68    1.65      6901 KB/s


Any feedback would be appreciated. After more thorough test, I'd
like to bring it to the tree as an alternative ar.

Testing I've done:

1. BSD ar's own test suite. (you can find it in the tarball)
2. make universe.

Kai Wang

_______________________________________________
[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: [Call for testers] "BSD ar"

Kris Kennaway-3
Kai Wang wrote:

> Any feedback would be appreciated. After more thorough test, I'd
> like to bring it to the tree as an alternative ar.
>
> Testing I've done:
>
> 1. BSD ar's own test suite. (you can find it in the tarball)
> 2. make universe.
>
> Kai Wang

Hi Kai,

This is exciting work!  If you think it is ready, we could schedule a
full build of the ports tree to see how well it holds up under wider
testing.

Kris
_______________________________________________
[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: [Call for testers] "BSD ar"

Steve Kargl
In reply to this post by Kai Wang
On Fri, Jan 11, 2008 at 03:23:36PM +0100, Kai Wang wrote:
>
> I think it's time for "BSD ar" to get a public review after months of
> bug hunting and cleaning up done by jkoshy@ and me.  The majority of
> the coding work was done during the summer of 2007 and was sponsored
> by Google SoC 2007 programme.
>
> You can find the tarball at:
> http://web.student.chalmers.se/~kaiw/patch/ar-20080111.tgz
>

Do I drop the ar/ directory into src/usr.bin as a replacement
for the current ar/?

--
Steve
_______________________________________________
[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: [Call for testers] "BSD ar"

Kai Wang
On Fri, Jan 11, 2008 at 11:40:36AM -0800, Steve Kargl wrote:

> On Fri, Jan 11, 2008 at 03:23:36PM +0100, Kai Wang wrote:
> >
> > I think it's time for "BSD ar" to get a public review after months of
> > bug hunting and cleaning up done by jkoshy@ and me.  The majority of
> > the coding work was done during the summer of 2007 and was sponsored
> > by Google SoC 2007 programme.
> >
> > You can find the tarball at:
> > http://web.student.chalmers.se/~kaiw/patch/ar-20080111.tgz
> >
>
> Do I drop the ar/ directory into src/usr.bin as a replacement
> for the current ar/?

Then make buildworld?
This will possibly not work because you may need to turn off
the build of GNU ar first, which is not simple because the build of other
GNU tools may depend on the build of GNU ar. (I'm working on this)

The recommended way is: (for now)

1. Backup your GNU ar first:
  % cp /usr/bin/ar SOME_BACKUP_DIR

2. Build BSD ar
  extract the tarball
  % cd ar
  % make

3. Replace
  # cp ./ar /usr/bin/ar
  # cd /usr/bin
  # ln -f ar ranlib

Then you can do something like ports build or "make buildworld"
to try it out.

Later when you need to recover GNU ar:

  # cp SOME_BACKUP_DIR/ar /usr/bin/ar
  # cd /usr/bin
  # ln -f ar ranlib


BTW: Please use the version I packed up today, which fixed two bugs
reported by swell.k[AT]gmail[Dot]com yesterday.

http://web.student.chalmers.se/~kaiw/patch/ar-20080112.tgz

--
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: [Call for testers] "BSD ar"

Peter Wemm-2
On Jan 11, 2008 11:21 PM, Kai Wang <[hidden email]> wrote:

> On Fri, Jan 11, 2008 at 11:40:36AM -0800, Steve Kargl wrote:
> > On Fri, Jan 11, 2008 at 03:23:36PM +0100, Kai Wang wrote:
> > >
> > > I think it's time for "BSD ar" to get a public review after months of
> > > bug hunting and cleaning up done by jkoshy@ and me.  The majority of
> > > the coding work was done during the summer of 2007 and was sponsored
> > > by Google SoC 2007 programme.
> > >
> > > You can find the tarball at:
> > > http://web.student.chalmers.se/~kaiw/patch/ar-20080111.tgz
> > >
> >
> > Do I drop the ar/ directory into src/usr.bin as a replacement
> > for the current ar/?
>
> Then make buildworld?
> This will possibly not work because you may need to turn off
> the build of GNU ar first, which is not simple because the build of other
> GNU tools may depend on the build of GNU ar. (I'm working on this)

I have a request.. can you put it in src/usr.bin/ar and make a build
hook to turn it on or off?  By all means, leave it off to start with
if you're not sure that it is ready, but it would be nice to capture
it in the tree.

Perhaps something like a temporary -DWITH_BSDAR switch for building
world would do.

--
Peter Wemm - [hidden email]; [hidden email]; [hidden email]
"All of this is for nothing if we don't go to the stars" - JMS/B5
_______________________________________________
[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: [Call for testers] "BSD ar"

Kai Wang
In reply to this post by Kai Wang
On Sat, Jan 12, 2008 at 08:21:38AM +0100, Kai Wang wrote:

> The recommended way is: (for now)
>
> 1. Backup your GNU ar first:
>   % cp /usr/bin/ar SOME_BACKUP_DIR
>
> 2. Build BSD ar
>   extract the tarball
>   % cd ar
>   % make
>
> 3. Replace
>   # cp ./ar /usr/bin/ar
>   # cd /usr/bin
>   # ln -f ar ranlib
>
> Then you can do something like ports build or "make buildworld"
> to try it out.
>
> Later when you need to recover GNU ar:
>
>   # cp SOME_BACKUP_DIR/ar /usr/bin/ar
>   # cd /usr/bin
>   # ln -f ar ranlib

This won't work as GNU ranlib is not merely a hardlink to ar.
Thus correct way would be:

1. Backup your GNU ar and ranlib first:
   % cp /usr/bin/ar SOME_BACKUP_DIR
   % cp /usr/bin/ranlib SOME_BACKUP_DIR
 
2. Build BSD ar
   extract the tarball
   % cd ar
   % make
 
3. Replace
   # cp ./ar /usr/bin/ar
   # cd /usr/bin
   # ln -f ar ranlib


When recover GNU ar:

   # cp SOME_BACKUP_DIR/ar /usr/bin/ar
   # cp SOME_BACKUP_DIR/ranlib /usr/bin/ranlib

Sorry for the mess...

BTW: I'm working on a patch for -CURRENT as peter@ just suggested.
_______________________________________________
[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: [Call for testers][PATCH] "BSD ar"

Kai Wang
In reply to this post by Peter Wemm-2
On Sat, Jan 12, 2008 at 12:16:48AM -0800, Peter Wemm wrote:
> I have a request.. can you put it in src/usr.bin/ar and make a build
> hook to turn it on or off?  By all means, leave it off to start with
> if you're not sure that it is ready, but it would be nice to capture
> it in the tree.
>
> Perhaps something like a temporary -DWITH_BSDAR switch for building
> world would do.

Good idea. Here comes the patch:
http://web.student.chalmers.se/~kaiw/patch/ar-20080112.diff

To apply it:
    # cd /usr/src
    # patch -p1 < PATH/ar-20080112.diff

To enable the build of BSD ar: (disable GNU ar)
    # cd /usr/src
    # make buildworld -DWITH_BSDAR
    # ...
    # make installworld -DWITH_BSDAR


Any feedback would be greatly appreciated :)

Kai Wang
_______________________________________________
[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: [Call for testers] "BSD ar"

Bernd Walter
In reply to this post by Kai Wang
On Sat, Jan 12, 2008 at 08:21:38AM +0100, Kai Wang wrote:

> On Fri, Jan 11, 2008 at 11:40:36AM -0800, Steve Kargl wrote:
> > Do I drop the ar/ directory into src/usr.bin as a replacement
> > for the current ar/?
>
> Then make buildworld?
> This will possibly not work because you may need to turn off
> the build of GNU ar first, which is not simple because the build of other
> GNU tools may depend on the build of GNU ar. (I'm working on this)
>
> The recommended way is: (for now)
>
> 1. Backup your GNU ar first:
>   % cp /usr/bin/ar SOME_BACKUP_DIR
>
> 2. Build BSD ar
>   extract the tarball
>   % cd ar
>   % make
>
> 3. Replace
>   # cp ./ar /usr/bin/ar
>   # cd /usr/bin
>   # ln -f ar ranlib
>
> Then you can do something like ports build or "make buildworld"
> to try it out.

But then it is only used for building the toolchain, not for building
the world/universe itself.
Did you try adding it into the toolchain for your make universe tests?
I don't know how sensitive ar is to cross builds, but of course it is
important for us to support cross builds.
Nevertheless I think it is great to have a replacement.
We have a lot of additional traditional tools under the BSD licence
and I feel more and more comfortable with this.

--
B.Walter                http://www.bwct.de      http://www.fizon.de
[hidden email]           [hidden email]            [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: [Call for testers] "BSD ar"

Kai Wang
On Sat, Jan 12, 2008 at 03:12:02PM +0100, Bernd Walter wrote:
> But then it is only used for building the toolchain, not for building
> the world/universe itself.
> Did you try adding it into the toolchain for your make universe tests?
> I don't know how sensitive ar is to cross builds, but of course it is
> important for us to support cross builds.

I mentioned that I've done "make universe" in the first post, I meant
that I've test the build of ar itself in various archs.

Do you mean that I should use "BSD ar" to perform a "make world/universe",
observing the process and examing the resulting library files generated?

Yes. That's what I am doing now :) , but it takes time since "make universe"
is not so fast on a slow laptop...
_______________________________________________
[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: [Call for testers] "BSD ar"

Steve Kargl
In reply to this post by Kai Wang
On Sat, Jan 12, 2008 at 08:21:38AM +0100, Kai Wang wrote:

> On Fri, Jan 11, 2008 at 11:40:36AM -0800, Steve Kargl wrote:
> > On Fri, Jan 11, 2008 at 03:23:36PM +0100, Kai Wang wrote:
> > >
> > > I think it's time for "BSD ar" to get a public review after months of
> > > bug hunting and cleaning up done by jkoshy@ and me.  The majority of
> > > the coding work was done during the summer of 2007 and was sponsored
> > > by Google SoC 2007 programme.
> > >
> > > You can find the tarball at:
> > > http://web.student.chalmers.se/~kaiw/patch/ar-20080111.tgz
> > >
> >
> > Do I drop the ar/ directory into src/usr.bin as a replacement
> > for the current ar/?
>
> Then make buildworld?
> This will possibly not work because you may need to turn off
> the build of GNU ar first, which is not simple because the build of other
> GNU tools may depend on the build of GNU ar. (I'm working on this)
>
> The recommended way is: (for now)
>

(instruction removed.)

>
> BTW: Please use the version I packed up today, which fixed two bugs
> reported by swell.k[AT]gmail[Dot]com yesterday.
>
> http://web.student.chalmers.se/~kaiw/patch/ar-20080112.tgz

Kai,

I thought/knew there would be a delay between my post and
your response, so I just tried building your ar outside
of src/.  It now resides in ${HOME}/bin.

One thing I noticed is that it appears to have no support
for the GNU long option names.  At least, "ar --help" told
me that it was an illegal option.  Do you plan to add long
option support?  I suspect that this will be needed by the
ports collection, and probably anything that uses libtool.

--
Steve
_______________________________________________
[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: [Call for testers] "BSD ar"

Peter Wemm-2
On Jan 12, 2008 10:13 AM, Steve Kargl <[hidden email]> wrote:

> On Sat, Jan 12, 2008 at 08:21:38AM +0100, Kai Wang wrote:
> > On Fri, Jan 11, 2008 at 11:40:36AM -0800, Steve Kargl wrote:
> > > On Fri, Jan 11, 2008 at 03:23:36PM +0100, Kai Wang wrote:
> > > >
> > > > I think it's time for "BSD ar" to get a public review after months of
> > > > bug hunting and cleaning up done by jkoshy@ and me.  The majority of
> > > > the coding work was done during the summer of 2007 and was sponsored
> > > > by Google SoC 2007 programme.
> > > >
> > > > You can find the tarball at:
> > > > http://web.student.chalmers.se/~kaiw/patch/ar-20080111.tgz
> > > >
> > >
> > > Do I drop the ar/ directory into src/usr.bin as a replacement
> > > for the current ar/?
> >
> > Then make buildworld?
> > This will possibly not work because you may need to turn off
> > the build of GNU ar first, which is not simple because the build of other
> > GNU tools may depend on the build of GNU ar. (I'm working on this)
> >
> > The recommended way is: (for now)
> >
>
> (instruction removed.)
>
> >
> > BTW: Please use the version I packed up today, which fixed two bugs
> > reported by swell.k[AT]gmail[Dot]com yesterday.
> >
> > http://web.student.chalmers.se/~kaiw/patch/ar-20080112.tgz
>
> Kai,
>
> I thought/knew there would be a delay between my post and
> your response, so I just tried building your ar outside
> of src/.  It now resides in ${HOME}/bin.
>
> One thing I noticed is that it appears to have no support
> for the GNU long option names.  At least, "ar --help" told
> me that it was an illegal option.  Do you plan to add long
> option support?  I suspect that this will be needed by the
> ports collection, and probably anything that uses libtool.

The gnu autoconf stuff never used to need long options...  Yes, they'd
sometimes detect 'GNU ld' etc, but it always used to work with
standard unix args.

--
Peter Wemm - [hidden email]; [hidden email]; [hidden email]
"All of this is for nothing if we don't go to the stars" - JMS/B5
_______________________________________________
[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: [Call for testers] "BSD ar"

Kai Wang
In reply to this post by Steve Kargl
On Sat, Jan 12, 2008 at 10:13:44AM -0800, Steve Kargl wrote:
> I thought/knew there would be a delay between my post and
> your response, so I just tried building your ar outside
> of src/.  It now resides in ${HOME}/bin.
>
> One thing I noticed is that it appears to have no support
> for the GNU long option names.  At least, "ar --help" told
> me that it was an illegal option.  Do you plan to add long
> option support?  I suspect that this will be needed by the
> ports collection, and probably anything that uses libtool.

Steve,

Thank you for pointing out this. I just appended "add long option
support" to my TODO list. We need this also because our goal is to
maximize the compatibiliy with GNU ar.

--
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: [Call for testers] "BSD ar"

Bernd Walter
In reply to this post by Kai Wang
On Sat, Jan 12, 2008 at 03:37:03PM +0100, Kai Wang wrote:

> On Sat, Jan 12, 2008 at 03:12:02PM +0100, Bernd Walter wrote:
> > But then it is only used for building the toolchain, not for building
> > the world/universe itself.
> > Did you try adding it into the toolchain for your make universe tests?
> > I don't know how sensitive ar is to cross builds, but of course it is
> > important for us to support cross builds.
>
> I mentioned that I've done "make universe" in the first post, I meant
> that I've test the build of ar itself in various archs.
>
> Do you mean that I should use "BSD ar" to perform a "make world/universe",
> observing the process and examing the resulting library files generated?

Yes - that's what I ment.

> Yes. That's what I am doing now :) , but it takes time since "make universe"
> is not so fast on a slow laptop...

Great.
I can't await having another GPL tool being obsoleted :)

--
B.Walter                http://www.bwct.de      http://www.fizon.de
[hidden email]           [hidden email]            [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: [Call for testers] "BSD ar"

David O'Brien
In reply to this post by Kai Wang
On Fri, Jan 11, 2008 at 03:23:36PM +0100, Kai Wang wrote:
> BSD ar is mostly compatible with GNU ar and it has advantages like:

Can your 'ar' handle multiple targets?

amd64$ ar --help
..snip..
ar: supported targets: elf64-x86-64 elf32-i386-freebsd srec symbolsrec tekhex binary ihex

If not, I don't think its ready to be a Bintuils 'ar' replacement.

--
-- 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: [Call for testers] "BSD ar"

Kai Wang
Hi David,

On Sun, Jan 13, 2008 at 02:35:01AM -0800, David O'Brien wrote:
> Can your 'ar' handle multiple targets?

"BSD ar" only support ELF binaries.

> amd64$ ar --help
> ..snip..
> ar: supported targets: elf64-x86-64 elf32-i386-freebsd srec symbolsrec tekhex binary ihex

In this specific case, BSD ar can not handle S-Record, tekhex, iHex, etc.

> If not, I don't think its ready to be a Bintuils 'ar' replacement.

"BSD ar" never intends to completely replace Binutils 'ar'.  We only
want to give people an alternative. (which is self-sufficient,
suitable for use for FreeBSD to build itself, can build almost all the
ports, for example.)

BTW, It does have advantage in "multiple elf targets" though: In the
case above, this binutils 'ar' (build for amd64) can not handle
elf64-sparc64 or elf32-powerpc object files, while "BSD ar" can. (arch
independent)

--
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: [Call for testers] "BSD ar"

David O'Brien
On Sun, Jan 13, 2008 at 06:15:14PM +0100, Kai Wang wrote:
> On Sun, Jan 13, 2008 at 02:35:01AM -0800, David O'Brien wrote:
> > Can your 'ar' handle multiple targets?
..
> > amd64$ ar --help
> > ..snip..
> > ar: supported targets: elf64-x86-64 elf32-i386-freebsd srec symbolsrec tekhex binary ihex
..
> BTW, It does have advantage in "multiple elf targets" though: In the
> case above, this binutils 'ar' (build for amd64) can not handle
> elf64-sparc64 or elf32-powerpc object files, while "BSD ar" can. (arch
> independent)

Hi Kai,
I'm sorry I wasn't clear enough - can your BSD 'ar', built on amd64
handle both 32-bit (i.e., "i386") and 64-bit (i.e., "amd64) ELF archives?

>From the above it almost seems you're saying it can handle that plus more
(other non-x86 arches).  Is that correct?
 
--
-- 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: [Call for testers] "BSD ar"

Kai Wang
On Sun, Jan 13, 2008 at 10:39:15AM -0800, David O'Brien wrote:
> Hi Kai,
> I'm sorry I wasn't clear enough - can your BSD 'ar', built on amd64
> handle both 32-bit (i.e., "i386") and 64-bit (i.e., "amd64) ELF archives?
>
> >From the above it almost seems you're saying it can handle that plus more
> (other non-x86 arches).  Is that correct?

Yes. BSD 'ar' can handle all the ELF variants(64/32, LE/BE),
regardless of the arch it is built on . This is inherited from libelf.

--
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: [Call for testers] "BSD ar"

Peter Wemm-2
On Jan 13, 2008 11:10 AM, Kai Wang <[hidden email]> wrote:

> On Sun, Jan 13, 2008 at 10:39:15AM -0800, David O'Brien wrote:
> > Hi Kai,
> > I'm sorry I wasn't clear enough - can your BSD 'ar', built on amd64
> > handle both 32-bit (i.e., "i386") and 64-bit (i.e., "amd64) ELF archives?
> >
> > >From the above it almost seems you're saying it can handle that plus more
> > (other non-x86 arches).  Is that correct?
>
> Yes. BSD 'ar' can handle all the ELF variants(64/32, LE/BE),
> regardless of the arch it is built on . This is inherited from libelf.

Speaking of libelf..  Do you think I can tempt anybody into writing a
mcs(1) program?

http://cc.in2p3.fr/doc/phpman.php/man/mcs/1

DESCRIPTION
     The mcs command is used to manipulate a section, by  default
     the  .comment  section, in an ELF object file. It is used to
     add to, delete, print, and compress the contents of  a  sec-
     tion in an ELF object file ...

The main usefulness is adding custom comments to the #ident section,
printing the contents (ala ident(1)), removing duplicate comments, or
stripping the comments totally.

I've always missed this program...  it never made it into binutils.
--
Peter Wemm - [hidden email]; [hidden email]; [hidden email]
"All of this is for nothing if we don't go to the stars" - JMS/B5
_______________________________________________
[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: [Call for testers] "BSD ar"

Alexey Shuvaev-2
In reply to this post by Kai Wang
On Sat, Jan 12, 2008 at 09:51:34AM +0100, Kai Wang wrote:

>
> This won't work as GNU ranlib is not merely a hardlink to ar.
> Thus correct way would be:
>
> 1. Backup your GNU ar and ranlib first:
>    % cp /usr/bin/ar SOME_BACKUP_DIR
>    % cp /usr/bin/ranlib SOME_BACKUP_DIR
>  
> 2. Build BSD ar
>    extract the tarball
>    % cd ar
>    % make
>  
> 3. Replace
>    # cp ./ar /usr/bin/ar
>    # cd /usr/bin
>    # ln -f ar ranlib
>
>
> When recover GNU ar:
>
>    # cp SOME_BACKUP_DIR/ar /usr/bin/ar
>    # cp SOME_BACKUP_DIR/ranlib /usr/bin/ranlib
>
> Sorry for the mess...
>
> BTW: I'm working on a patch for -CURRENT as peter@ just suggested.

Ok, first bad news...
Well, maybe not so bad, and maybe not so new...

I have tried to compile editors/openoffice.org-2 on amd64 8-CURRENT
machine. It fails while compiling:

[snip]
=============
Building project nas
=============
/usr/ports/editors/openoffice.org-2/work/OOG680_m9/nas
mkout -- version: 1.7
-------------
[snip]

What it tries to execute exactly is, for example:

[snip]
rm -f libvoxware.a
ar clq libvoxware.a auvoxware.o config.o
usage:  ar -d [-jsvz] archive file ...
        ar -m [-jsvz] archive file ...
        ar -m [-abijsvz] position archive file ...
        ar -p [-v] archive [file ...]
        ar -r [-cjsuvz] archive file ...
        ar -r [-abcijsuvz] position archive file ...
        ar -s [-jz] archive
        ar -t [-v] archive [file ...]
        ar -x [-Couv] archive [file ...]
        ar -V
*** Error code 64
`all' not remade because of errors.
[snip]

>From GNU ar(1) man page, FWIW:

[snip]
       q   Quick  append;  Historically, add the files member... to the end of
           archive, without checking for replacement.

           The modifiers a, b, and i do not affect this operation; new members
           are always placed at the end of the archive.

           The modifier v makes ar list each file as it is appended.

           Since  the  point  of this operation is speed, the archive's symbol
           table index is not updated, even if it already existed; you can use
           ar s or ranlib explicitly to update the symbol table index.

           However,  too  many  different systems assume quick append rebuilds
           the index, so GNU ar implements q as a synonym for r.
[snip]
       c   Create the archive.  The specified archive is always created if  it
           did not exist, when you request an update.  But a warning is issued
           unless you specify in advance that you  expect  to  create  it,  by
           using this modifier.
[snip]
       l   This modifier is accepted but not used.
[snip]

Now I am trying to compile OOo-2 with GNU binutils ar, just to check
it is not the broken port at all.

Thanks nevertheless!

Alexey.
_______________________________________________
[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: [Call for testers] "BSD ar"

Kai Wang
On Mon, Jan 14, 2008 at 06:01:40PM +0100, Alexey Shuvaev wrote:

> Ok, first bad news...
> Well, maybe not so bad, and maybe not so new...
>
> I have tried to compile editors/openoffice.org-2 on amd64 8-CURRENT
> machine. It fails while compiling:
>
> [snip]
> =============
> Building project nas
> =============
> /usr/ports/editors/openoffice.org-2/work/OOG680_m9/nas
> mkout -- version: 1.7
> -------------
> [snip]
>
> What it tries to execute exactly is, for example:
>
> [snip]
> rm -f libvoxware.a
> ar clq libvoxware.a auvoxware.o config.o
> usage:  ar -d [-jsvz] archive file ...
>         ar -m [-jsvz] archive file ...
>         ar -m [-abijsvz] position archive file ...
>         ar -p [-v] archive [file ...]
>         ar -r [-cjsuvz] archive file ...
>         ar -r [-abcijsuvz] position archive file ...
>         ar -s [-jz] archive
>         ar -t [-v] archive [file ...]
>         ar -x [-Couv] archive [file ...]
>         ar -V
> *** Error code 64

Hi Alexey,

Thank you for reporting this bug. I listed option '-l' in the getopt's
optstring, but I forgot to write the corresponding case clause.

Please try again with the new tarball I just packed:
http://web.student.chalmers.se/~kaiw/patch/ar-20080114.tgz

--
Kai
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
12