Skip to contentSkip to conversation

Reset LD and AR environment variables

PATCH New Nicolas Dichtel 2 participants 2 messages Apr 14, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Reset LD and AR environment variables

The goal is to fix the compilation of perf (from linux) when LD or AR variables are inherited from the environment.
After the linux upstream commits 5ef7bbb09f7b ("perf tools: Allow to specify custom linker command") and 3c71ba3f80bb ("perf tools: Really allow to specify custom CC, AR or LD") CC, AR, and LD variables are not overridden if they are inherited.

In case of a cross compilation, it results in an inconsistent state: CC is overridden but not LD and AR.

Linux-patch: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=5ef7bbb09f7b
Linux-patch: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=3c71ba3f80bb

---
 Makefile | 2 ++
 1 file changed, 2 insertions(+)
Makefile +2 -0
index ea8b1e4e51c8..55735ea735ae 100644
@@ -343,6 +343,8 @@ ifeq ($(BR2_HAVE_DOT_CONFIG),y)
 unexport CROSS_COMPILE
 unexport ARCH
 unexport CC
+unexport LD
+unexport AR
 unexport CXX
 unexport CPP
 unexport RANLIB
Signature · 1 line
2.4.2
#1 lore raw

PATCH 1/1 Reset LD and AR environment variables

Quoted 7 lines · Nicolas Dichtel

The goal is to fix the compilation of perf (from linux) when LD or AR variables are inherited from the environment.
After the linux upstream commits 5ef7bbb09f7b ("perf tools: Allow to specify custom linker command") and 3c71ba3f80bb ("perf tools: Really allow to specify custom CC, AR or LD") CC, AR, and LD variables are not overridden if they are inherited.

Quoted 6 lines

In case of a cross compilation, it results in an inconsistent state: CC is overridden but not LD and AR.

Linux-patch: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=5ef7bbb09f7b
Linux-patch: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=3c71ba3f80bb

Regards,
Arnout

Quoted 18 lines
---
  Makefile | 2 ++
  1 file changed, 2 insertions(+)
Makefile +2 -0
index ea8b1e4e51c8..55735ea735ae 100644
@@ -343,6 +343,8 @@ ifeq ($(BR2_HAVE_DOT_CONFIG),y)
  unexport CROSS_COMPILE
  unexport ARCH
  unexport CC
+unexport LD
+unexport AR
  unexport CXX
  unexport CPP
  unexport RANLIB
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF