mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* kernel library ordering
@ 2005-10-31 18:48 Nicolas Pitre
  2005-11-02 21:49 ` Sam Ravnborg
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Pitre @ 2005-10-31 18:48 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Russell King, lkml


In the latest kernel, there is an optimized sha1 routine 
(arch/arm/lib/sha1.S) meant to override the generic one in lib/sha1.c.

The problem is that lib/lib.a is listed _before_ arch/arm/lib/lib.a in 
the link argument list so the architecture specific lib functions are 
not picked up in priority.

To work around this the following patch is needed:

--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -142,7 +142,7 @@ drivers-$(CONFIG_OPROFILE)      += arch/
 drivers-$(CONFIG_ARCH_CLPS7500)	+= drivers/acorn/char/
 drivers-$(CONFIG_ARCH_L7200)	+= drivers/acorn/char/
 
-libs-y				+= arch/arm/lib/
+libs-y				:= arch/arm/lib/ $(libs-y)
 
 # Default target when executing plain make
 ifeq ($(CONFIG_XIP_KERNEL),y)

However I was wondering if there should be a better and generic way to 
fix that.

Comments?


Nicolas

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

* Re: kernel library ordering
  2005-10-31 18:48 kernel library ordering Nicolas Pitre
@ 2005-11-02 21:49 ` Sam Ravnborg
  0 siblings, 0 replies; 2+ messages in thread
From: Sam Ravnborg @ 2005-11-02 21:49 UTC (permalink / raw)
  To: Nicolas Pitre; +Cc: Russell King, lkml

On Mon, Oct 31, 2005 at 01:48:49PM -0500, Nicolas Pitre wrote:
> 
> In the latest kernel, there is an optimized sha1 routine 
> (arch/arm/lib/sha1.S) meant to override the generic one in lib/sha1.c.
> 
> The problem is that lib/lib.a is listed _before_ arch/arm/lib/lib.a in 
> the link argument list so the architecture specific lib functions are 
> not picked up in priority.
> 
> To work around this the following patch is needed:
> 
> --- a/arch/arm/Makefile
> +++ b/arch/arm/Makefile
> @@ -142,7 +142,7 @@ drivers-$(CONFIG_OPROFILE)      += arch/
>  drivers-$(CONFIG_ARCH_CLPS7500)	+= drivers/acorn/char/
>  drivers-$(CONFIG_ARCH_L7200)	+= drivers/acorn/char/
>  
> -libs-y				+= arch/arm/lib/
> +libs-y				:= arch/arm/lib/ $(libs-y)
>  
>  # Default target when executing plain make
>  ifeq ($(CONFIG_XIP_KERNEL),y)
> 
> However I was wondering if there should be a better and generic way to 
> fix that.
This looks like an obvious way to achive correct ordering.
We could change it so arch defines always took precedence but
the above is so simple that it is not worth the effort.

	Sam

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

end of thread, other threads:[~2005-11-02 21:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-31 18:48 kernel library ordering Nicolas Pitre
2005-11-02 21:49 ` Sam Ravnborg

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

all inboxes | Powered by JetHome®