All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen: remove the usage of the P ar option
@ 2020-12-30 17:34 Roger Pau Monne
  2020-12-30 18:32 ` Andrew Cooper
  0 siblings, 1 reply; 6+ messages in thread
From: Roger Pau Monne @ 2020-12-30 17:34 UTC (permalink / raw)
  To: xen-devel
  Cc: Roger Pau Monne, Andrew Cooper, George Dunlap, Ian Jackson,
	Jan Beulich, Julien Grall, Stefano Stabellini, Wei Liu

It's not part of the POSIX standard [0] and as such non GNU ar
implementations don't usually have it.

It's not relevant for the use case here anyway, as the archive file is
recreated every time due to the rm invocation before the ar call. No
file name matching should happen so matching using the full path name
or a relative one should yield the same result.

This fixes the build on FreeBSD.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

[0] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ar.html
---
I'm unsure whether the r and s options are also needed, since they
seem to only be relevant when updating a library, and Xen build system
always removes the old library prior to any ar call.
---
 xen/Rules.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index aba6ca2a90..8fcffffc98 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -71,7 +71,7 @@ cmd_ld = $(LD) $(XEN_LDFLAGS) -r -o $@ $(filter-out %.a,$(real-prereqs)) \
 # ---------------------------------------------------------------------------
 
 quiet_cmd_ar = AR      $@
-cmd_ar = rm -f $@; $(AR) cPrs $@ $(real-prereqs)
+cmd_ar = rm -f $@; $(AR) crs $@ $(real-prereqs)
 
 # Objcopy
 # ---------------------------------------------------------------------------
-- 
2.29.2



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

* Re: [PATCH] xen: remove the usage of the P ar option
  2020-12-30 17:34 [PATCH] xen: remove the usage of the P ar option Roger Pau Monne
@ 2020-12-30 18:32 ` Andrew Cooper
  2020-12-31  9:20   ` Roger Pau Monné
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Cooper @ 2020-12-30 18:32 UTC (permalink / raw)
  To: Roger Pau Monne, xen-devel
  Cc: George Dunlap, Ian Jackson, Jan Beulich, Julien Grall,
	Stefano Stabellini, Wei Liu

On 30/12/2020 17:34, Roger Pau Monne wrote:
> It's not part of the POSIX standard [0] and as such non GNU ar
> implementations don't usually have it.
>
> It's not relevant for the use case here anyway, as the archive file is
> recreated every time due to the rm invocation before the ar call. No
> file name matching should happen so matching using the full path name
> or a relative one should yield the same result.
>
> This fixes the build on FreeBSD.
>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>, although...

We really need some kind of BSD build in CI.  This kind of breakage
shouldn't get into master to begin with.

>
> [0] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ar.html
> ---
> I'm unsure whether the r and s options are also needed, since they
> seem to only be relevant when updating a library, and Xen build system
> always removes the old library prior to any ar call.

... I think r should be dropped, because we're not replacing any files. 
However, I expect the index file is still relevant, because without it,
you've got to perform an O(n) search through the archive to find a file.

~Andrew


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

* Re: [PATCH] xen: remove the usage of the P ar option
  2020-12-30 18:32 ` Andrew Cooper
@ 2020-12-31  9:20   ` Roger Pau Monné
  2020-12-31 15:46     ` Andrew Cooper
  0 siblings, 1 reply; 6+ messages in thread
From: Roger Pau Monné @ 2020-12-31  9:20 UTC (permalink / raw)
  To: Andrew Cooper
  Cc: xen-devel, George Dunlap, Ian Jackson, Jan Beulich, Julien Grall,
	Stefano Stabellini, Wei Liu

On Wed, Dec 30, 2020 at 06:32:58PM +0000, Andrew Cooper wrote:
> On 30/12/2020 17:34, Roger Pau Monne wrote:
> > It's not part of the POSIX standard [0] and as such non GNU ar
> > implementations don't usually have it.
> >
> > It's not relevant for the use case here anyway, as the archive file is
> > recreated every time due to the rm invocation before the ar call. No
> > file name matching should happen so matching using the full path name
> > or a relative one should yield the same result.
> >
> > This fixes the build on FreeBSD.
> >
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> 
> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>, although...
> 
> We really need some kind of BSD build in CI.  This kind of breakage
> shouldn't get into master to begin with.

Fully agree. I'm not that familiar with gitlab CI, but since we have
our own runners there, could we also launch VMs instead of just using
containers?

It might be easier to integrate with osstest in the future, since
FreeBSD has now switched to git.

> >
> > [0] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ar.html
> > ---
> > I'm unsure whether the r and s options are also needed, since they
> > seem to only be relevant when updating a library, and Xen build system
> > always removes the old library prior to any ar call.
> 
> ... I think r should be dropped, because we're not replacing any files. 
> However, I expect the index file is still relevant, because without it,
> you've got to perform an O(n) search through the archive to find a file.

Right, the description of 's' between opengroup and the Linux man page
seems to be slightly different. From the opengroup description it seems
like s should be used to force the generation of a symbol table when
no changes are made to the archive, but otherwise ar should already
generate such symbol table.

Thanks, Roger.


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

* Re: [PATCH] xen: remove the usage of the P ar option
  2020-12-31  9:20   ` Roger Pau Monné
@ 2020-12-31 15:46     ` Andrew Cooper
  2020-12-31 16:05       ` Roger Pau Monné
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Cooper @ 2020-12-31 15:46 UTC (permalink / raw)
  To: Roger Pau Monné
  Cc: xen-devel, George Dunlap, Ian Jackson, Jan Beulich, Julien Grall,
	Stefano Stabellini, Wei Liu

On 31/12/2020 09:20, Roger Pau Monné wrote:
> On Wed, Dec 30, 2020 at 06:32:58PM +0000, Andrew Cooper wrote:
>> On 30/12/2020 17:34, Roger Pau Monne wrote:
>>> It's not part of the POSIX standard [0] and as such non GNU ar
>>> implementations don't usually have it.
>>>
>>> It's not relevant for the use case here anyway, as the archive file is
>>> recreated every time due to the rm invocation before the ar call. No
>>> file name matching should happen so matching using the full path name
>>> or a relative one should yield the same result.
>>>
>>> This fixes the build on FreeBSD.
>>>
>>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
>> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>, although...
>>
>> We really need some kind of BSD build in CI.  This kind of breakage
>> shouldn't get into master to begin with.
> Fully agree. I'm not that familiar with gitlab CI, but since we have
> our own runners there, could we also launch VMs instead of just using
> containers?
>
> It might be easier to integrate with osstest in the future, since
> FreeBSD has now switched to git.
>
>>> [0] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ar.html
>>> ---
>>> I'm unsure whether the r and s options are also needed, since they
>>> seem to only be relevant when updating a library, and Xen build system
>>> always removes the old library prior to any ar call.
>> ... I think r should be dropped, because we're not replacing any files. 
>> However, I expect the index file is still relevant, because without it,
>> you've got to perform an O(n) search through the archive to find a file.
> Right, the description of 's' between opengroup and the Linux man page
> seems to be slightly different. From the opengroup description it seems
> like s should be used to force the generation of a symbol table when
> no changes are made to the archive, but otherwise ar should already
> generate such symbol table.

Ok - are you happy for me to commit with dropping the r and s?

~Andrew


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

* Re: [PATCH] xen: remove the usage of the P ar option
  2020-12-31 15:46     ` Andrew Cooper
@ 2020-12-31 16:05       ` Roger Pau Monné
  2020-12-31 16:14         ` Andrew Cooper
  0 siblings, 1 reply; 6+ messages in thread
From: Roger Pau Monné @ 2020-12-31 16:05 UTC (permalink / raw)
  To: Andrew Cooper
  Cc: xen-devel, George Dunlap, Ian Jackson, Jan Beulich, Julien Grall,
	Stefano Stabellini, Wei Liu

On Thu, Dec 31, 2020 at 03:46:50PM +0000, Andrew Cooper wrote:
> On 31/12/2020 09:20, Roger Pau Monné wrote:
> > On Wed, Dec 30, 2020 at 06:32:58PM +0000, Andrew Cooper wrote:
> >> On 30/12/2020 17:34, Roger Pau Monne wrote:
> >>> It's not part of the POSIX standard [0] and as such non GNU ar
> >>> implementations don't usually have it.
> >>>
> >>> It's not relevant for the use case here anyway, as the archive file is
> >>> recreated every time due to the rm invocation before the ar call. No
> >>> file name matching should happen so matching using the full path name
> >>> or a relative one should yield the same result.
> >>>
> >>> This fixes the build on FreeBSD.
> >>>
> >>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> >> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>, although...
> >>
> >> We really need some kind of BSD build in CI.  This kind of breakage
> >> shouldn't get into master to begin with.
> > Fully agree. I'm not that familiar with gitlab CI, but since we have
> > our own runners there, could we also launch VMs instead of just using
> > containers?
> >
> > It might be easier to integrate with osstest in the future, since
> > FreeBSD has now switched to git.
> >
> >>> [0] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ar.html
> >>> ---
> >>> I'm unsure whether the r and s options are also needed, since they
> >>> seem to only be relevant when updating a library, and Xen build system
> >>> always removes the old library prior to any ar call.
> >> ... I think r should be dropped, because we're not replacing any files. 
> >> However, I expect the index file is still relevant, because without it,
> >> you've got to perform an O(n) search through the archive to find a file.
> > Right, the description of 's' between opengroup and the Linux man page
> > seems to be slightly different. From the opengroup description it seems
> > like s should be used to force the generation of a symbol table when
> > no changes are made to the archive, but otherwise ar should already
> > generate such symbol table.
> 
> Ok - are you happy for me to commit with dropping the r and s?

So after testing this, I think we need at least the r option, as we
want to add new files to the archive (regardless of whether it exists
or not). That seems to be mandatory on FreeBSD, as calling 'ar c' is
not valid.

I think s can be dropped, as ar will generate the symbol table by
default unless S is specified. s should just be used to force the
generation of a symbol table when not adding files and the archive has
been stripped AFAICT.

If so would you mind adding:

"While there also drop the s option, as ar will already generate a
symbol table by default when creating the archive."

To the commit message if you end up dropping s?

Thanks, Roger.


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

* Re: [PATCH] xen: remove the usage of the P ar option
  2020-12-31 16:05       ` Roger Pau Monné
@ 2020-12-31 16:14         ` Andrew Cooper
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Cooper @ 2020-12-31 16:14 UTC (permalink / raw)
  To: Roger Pau Monné
  Cc: xen-devel, George Dunlap, Ian Jackson, Jan Beulich, Julien Grall,
	Stefano Stabellini, Wei Liu

On 31/12/2020 16:05, Roger Pau Monné wrote:
> On Thu, Dec 31, 2020 at 03:46:50PM +0000, Andrew Cooper wrote:
>> On 31/12/2020 09:20, Roger Pau Monné wrote:
>>> On Wed, Dec 30, 2020 at 06:32:58PM +0000, Andrew Cooper wrote:
>>>> On 30/12/2020 17:34, Roger Pau Monne wrote:
>>>>> It's not part of the POSIX standard [0] and as such non GNU ar
>>>>> implementations don't usually have it.
>>>>>
>>>>> It's not relevant for the use case here anyway, as the archive file is
>>>>> recreated every time due to the rm invocation before the ar call. No
>>>>> file name matching should happen so matching using the full path name
>>>>> or a relative one should yield the same result.
>>>>>
>>>>> This fixes the build on FreeBSD.
>>>>>
>>>>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
>>>> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>, although...
>>>>
>>>> We really need some kind of BSD build in CI.  This kind of breakage
>>>> shouldn't get into master to begin with.
>>> Fully agree. I'm not that familiar with gitlab CI, but since we have
>>> our own runners there, could we also launch VMs instead of just using
>>> containers?
>>>
>>> It might be easier to integrate with osstest in the future, since
>>> FreeBSD has now switched to git.
>>>
>>>>> [0] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ar.html
>>>>> ---
>>>>> I'm unsure whether the r and s options are also needed, since they
>>>>> seem to only be relevant when updating a library, and Xen build system
>>>>> always removes the old library prior to any ar call.
>>>> ... I think r should be dropped, because we're not replacing any files. 
>>>> However, I expect the index file is still relevant, because without it,
>>>> you've got to perform an O(n) search through the archive to find a file.
>>> Right, the description of 's' between opengroup and the Linux man page
>>> seems to be slightly different. From the opengroup description it seems
>>> like s should be used to force the generation of a symbol table when
>>> no changes are made to the archive, but otherwise ar should already
>>> generate such symbol table.
>> Ok - are you happy for me to commit with dropping the r and s?
> So after testing this, I think we need at least the r option, as we
> want to add new files to the archive (regardless of whether it exists
> or not). That seems to be mandatory on FreeBSD, as calling 'ar c' is
> not valid.
>
> I think s can be dropped, as ar will generate the symbol table by
> default unless S is specified. s should just be used to force the
> generation of a symbol table when not adding files and the archive has
> been stripped AFAICT.
>
> If so would you mind adding:
>
> "While there also drop the s option, as ar will already generate a
> symbol table by default when creating the archive."
>
> To the commit message if you end up dropping s?

Will do.

~Andrew


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

end of thread, other threads:[~2020-12-31 16:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-30 17:34 [PATCH] xen: remove the usage of the P ar option Roger Pau Monne
2020-12-30 18:32 ` Andrew Cooper
2020-12-31  9:20   ` Roger Pau Monné
2020-12-31 15:46     ` Andrew Cooper
2020-12-31 16:05       ` Roger Pau Monné
2020-12-31 16:14         ` Andrew Cooper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.