All of lore.kernel.org
 help / color / mirror / Atom feed
* Bug: LDFLAGS is not cleared for kernel devshell
@ 2012-09-12  9:56 Björn Stenberg
  2012-09-12 13:33 ` Chris Larson
  0 siblings, 1 reply; 2+ messages in thread
From: Björn Stenberg @ 2012-09-12  9:56 UTC (permalink / raw)
  To: openembedded-core

Hi.

I couldn't figure out where to properly patch this, so I'll just raise the issue:

LDFLAGS is configured in bitbake.conf as linker flags to be passed to gcc, not to ld. Hence it uses the -Wl prefix.

The linux kernel build system inherits LDFLAGS from the environment and passes it directly to 'ld', in conflict with the bitbake view. This problem is avoided by clearing LDFLAGS and some other enviroment variables in kernel.bbclass:kernel_do_compile().

However this clearing is not done for do_devshell, resulting in errors when trying to compile the kernel in devshell:

-----
sestofb10:linux>make
scripts/kconfig/conf --silentoldconfig Kconfig
  WRAP    arch/arm/include/generated/asm/auxvec.h
  WRAP    arch/arm/include/generated/asm/bitsperlong.h
  WRAP    arch/arm/include/generated/asm/cputime.h
  WRAP    arch/arm/include/generated/asm/emergency-restart.h
  WRAP    arch/arm/include/generated/asm/errno.h
  WRAP    arch/arm/include/generated/asm/ioctl.h
  WRAP    arch/arm/include/generated/asm/irq_regs.h
  WRAP    arch/arm/include/generated/asm/kdebug.h
  WRAP    arch/arm/include/generated/asm/local.h
  WRAP    arch/arm/include/generated/asm/local64.h
  WRAP    arch/arm/include/generated/asm/percpu.h
  WRAP    arch/arm/include/generated/asm/poll.h
  WRAP    arch/arm/include/generated/asm/resource.h
  WRAP    arch/arm/include/generated/asm/sections.h
  WRAP    arch/arm/include/generated/asm/siginfo.h
  WRAP    arch/arm/include/generated/asm/sizes.h
  CHK     include/linux/version.h
  UPD     include/linux/version.h
  CHK     include/generated/utsrelease.h
  UPD     include/generated/utsrelease.h
  Generating include/generated/mach-types.h
  CC      kernel/bounds.s
  GEN     include/generated/bounds.h
  CC      arch/arm/kernel/asm-offsets.s
  GEN     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/modpost.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/conmakehash
  CC      init/main.o
  CHK     include/generated/compile.h
  UPD     include/generated/compile.h
  CC      init/version.o
  CC      init/do_mounts.o
  LD      init/mounts.o
arm-oe-linux-gnueabi-ld: unrecognized option '-Wl,-O1'
arm-oe-linux-gnueabi-ld: use the --help option for usage information
make[1]: *** [init/mounts.o] Error 1
make: *** [init] Error 2
sestofb10:linux>
-----

-- 
Björn



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

* Re: Bug: LDFLAGS is not cleared for kernel devshell
  2012-09-12  9:56 Bug: LDFLAGS is not cleared for kernel devshell Björn Stenberg
@ 2012-09-12 13:33 ` Chris Larson
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Larson @ 2012-09-12 13:33 UTC (permalink / raw)
  To: Björn Stenberg; +Cc: openembedded-core

On Wed, Sep 12, 2012 at 2:56 AM, Björn Stenberg <bjst@enea.com> wrote:
> I couldn't figure out where to properly patch this, so I'll just raise the issue:
>
> LDFLAGS is configured in bitbake.conf as linker flags to be passed to gcc, not to ld. Hence it uses the -Wl prefix.
>
> The linux kernel build system inherits LDFLAGS from the environment and passes it directly to 'ld', in conflict with the bitbake view. This problem is avoided by clearing LDFLAGS and some other enviroment variables in kernel.bbclass:kernel_do_compile().
>
> However this clearing is not done for do_devshell, resulting in errors when trying to compile the kernel in devshell:

We could unexport the appropriate variables rather than unsetting them
in the task.
E.g.
LDFLAGS[unexport] = "1"
-- 
Christopher Larson



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

end of thread, other threads:[~2012-09-12 13:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-12  9:56 Bug: LDFLAGS is not cleared for kernel devshell Björn Stenberg
2012-09-12 13:33 ` Chris Larson

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.