Skip to contentSkip to conversation

honor CROSS_COMPILE

PATCH In review Nishanth Menon 3 participants 9 messages Jan 7, 2011 – Dec 4, 2011 8 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 honor CROSS_COMPILE

Honor CROSS_COMPILE for builds. useful for folks using building for platforms like ARM using cross compiler toolchain. CC could be reused as well, but usage of CROSS_COMPILE seems more similar to what we have for u-boot, kernel etc..

---
against svn:
r5894 | khali | 2010-12-12 07:22:29 -0600 (Sun, 12 Dec 2010) | 3 lines

Make value arrays const for block write functions. Patch from Roman Fietze.

 Makefile |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
Makefile +13 -0
index b98a4c3..49e07fe 100644
@@ -21,7 +21,20 @@ INSTALL_DIR	:= $(INSTALL) -m 755 -d
 INSTALL_PROGRAM	:= $(INSTALL) -m 755
 RM		:= rm -f
 
+# Acknowledge if CROSS_COMPILE is used
+ifeq ($(CROSS_COMPILE),)
 CC	?= gcc
+else
+AS	= $(CROSS_COMPILE)as
+LD	= $(CROSS_COMPILE)ld
+CC	= $(CROSS_COMPILE)gcc
+AR	= $(CROSS_COMPILE)ar
+NM	= $(CROSS_COMPILE)nm
+LDR	= $(CROSS_COMPILE)ldr
+STRIP	= $(CROSS_COMPILE)strip
+OBJCOPY	= $(CROSS_COMPILE)objcopy
+OBJDUMP	= $(CROSS_COMPILE)objdump
+endif
 
 CFLAGS	?= -O2
 # When debugging, use the following instead
Signature · 1 line
1.6.3.3
#2 lore raw
In reply to a message not in the archive
Quoted 6 lines

Honor CROSS_COMPILE for builds. useful for folks using building for platforms like ARM using cross compiler toolchain. CC could be reused as well, but usage of CROSS_COMPILE seems more similar to what we have for u-boot, kernel etc..

Then again, the vast majority of userspace-projects do not use CROSS_COMPILE. Build systems like ptxdist and buildroot have done fine with overriding CC so far. I don't see much gain in that addition.

But thanks for the contribution anyway :)

Kind regards,

Wolfram

Signature · 2 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#4 lore raw
In reply to a message not in the archive

Wolfram Sang wrote, on 01/08/2011 01:23 PM:

Quoted 4 lines

Then again, the vast majority of userspace-projects do not use CROSS_COMPILE. Build systems like ptxdist and buildroot have done fine with overriding CC so far. I don't see much gain in that addition.

The same is true for CROSS_COMPILE as well.. since the patch does still allow CC to be over-ridden (as was the previous behavior), why not add CROSS_COMPILE as well considering folks who could be cross compiling just i2ctools without using buildroot and the likes?

Signature · 2 lines
Regards,
Nishanth Menon
#6 lore raw
In reply to a message not in the archive
Quoted 9 lines · Nishanth Menon

Wolfram Sang wrote, on 01/08/2011 01:23 PM:

Quoted 4 lines

Then again, the vast majority of userspace-projects do not use CROSS_COMPILE. Build systems like ptxdist and buildroot have done fine with overriding CC so far. I don't see much gain in that addition.

The same is true for CROSS_COMPILE as well.. since the patch does still allow CC to be over-ridden (as was the previous behavior), why not add CROSS_COMPILE as well considering folks who could be cross compiling just i2ctools without using buildroot and the likes?

You can override CC even without a build-system :) I would sum it up like this:
On the positive side you could call it "more flexible", on the negative side you could call it "redundant". I wouldn't pick it up, but I surely have no strong feelings about it. It is up to Jean, after all.

Kind regards,

Wolfram

Signature · 2 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#8 lore raw
In reply to a message not in the archive
Quoted 11 lines · Wolfram Sang
Quoted 9 lines · Nishanth Menon

Wolfram Sang wrote, on 01/08/2011 01:23 PM:

Quoted 4 lines

Then again, the vast majority of userspace-projects do not use CROSS_COMPILE. Build systems like ptxdist and buildroot have done fine with overriding CC so far. I don't see much gain in that addition.

The same is true for CROSS_COMPILE as well.. since the patch does still allow CC to be over-ridden (as was the previous behavior), why not add CROSS_COMPILE as well considering folks who could be cross compiling just i2ctools without using buildroot and the likes?

Quoted 4 lines

You can override CC even without a build-system :) I would sum it up like this:
On the positive side you could call it "more flexible", on the negative side you could call it "redundant". I wouldn't pick it up, but I surely have no strong feelings about it. It is up to Jean, after all.

I don't have a strong opinion on this either. But I don't get the point of setting values for AS, LD, AR etc. when they don't seem to be used anywhere. And STRIP is set too, but "strip" hard-coded in tools/Module.mk, so I fail to see how that would work. What am I missing?

Signature · 1 line
Jean Delvare
#10 lore raw
In reply to a message not in the archive

Jean Delvare had written, on 01/10/2011 08:26 AM, the following:

Quoted 16 lines · Wolfram Sang
Quoted 6 lines · Nishanth Menon
Quoted 5 lines

Wolfram Sang wrote, on 01/08/2011 01:23 PM:

Quoted 4 lines

Then again, the vast majority of userspace-projects do not use CROSS_COMPILE. Build systems like ptxdist and buildroot have done fine with overriding CC so far. I don't see much gain in that addition.

Quoted 8 lines
Quoted 4 lines

The same is true for CROSS_COMPILE as well.. since the patch does still allow CC to be over-ridden (as was the previous behavior), why not add CROSS_COMPILE as well considering folks who could be cross compiling just i2ctools without using buildroot and the likes?

You can override CC even without a build-system :) I would sum it up like this:
On the positive side you could call it "more flexible", on the negative side you could call it "redundant". I wouldn't pick it up, but I surely have no strong feelings about it. It is up to Jean, after all.

Quoted 5 lines

I don't have a strong opinion on this either. But I don't get the point of setting values for AS, LD, AR etc. when they don't seem to be used anywhere. And STRIP is set too, but "strip" hard-coded in tools/Module.mk, so I fail to see how that would work. What am I missing?

I think I should have done just CC alone. I missed the strip one. but are we interested in having CROSS_COMPILE? if yes, I can cleanup the patch and resubmit.

Signature · 2 lines
Regards,
Nishanth Menon
#12 lore raw
In reply to a message not in the archive
Quoted 9 lines · Nishanth Menon

Jean Delvare had written, on 01/10/2011 08:26 AM, the following:

Quoted 5 lines

I don't have a strong opinion on this either. But I don't get the point of setting values for AS, LD, AR etc. when they don't seem to be used anywhere. And STRIP is set too, but "strip" hard-coded in tools/Module.mk, so I fail to see how that would work. What am I missing?

I think I should have done just CC alone. I missed the strip one. but are we interested in having CROSS_COMPILE? if yes, I can cleanup the patch and resubmit.

Well, you proposed it, so you should know if you are interested ;)

What's certain is that I won't apply the patch as is, so it indeed needs to be cleaned up and resubmitted if you want me to apply it.

Signature · 1 line
Jean Delvare
#14 lore raw
In reply to a message not in the archive

Jean Delvare had written, on 01/10/2011 08:44 AM, the following:

Quoted 7 lines · Nishanth Menon
Quoted 6 lines

Jean Delvare had written, on 01/10/2011 08:26 AM, the following:

Quoted 5 lines

I don't have a strong opinion on this either. But I don't get the point of setting values for AS, LD, AR etc. when they don't seem to be used anywhere. And STRIP is set too, but "strip" hard-coded in tools/Module.mk, so I fail to see how that would work. What am I missing?

Quoted 7 lines
Quoted 1 line

I think I should have done just CC alone. I missed the strip one. but are we interested in having CROSS_COMPILE? if yes, I can cleanup the patch and resubmit.

Well, you proposed it, so you should know if you are interested ;)

What's certain is that I won't apply the patch as is, so it indeed needs to be cleaned up and resubmitted if you want me to apply it.

Touché ;). will resubmit it :) thanks for the pointers in strip. I will try to ensure that we have just the ones we need.

Signature · 2 lines
Regards,
Nishanth Menon
#16 lore raw
In reply to a message not in the archive
Quoted 6 lines · Nishanth Menon

Jean Delvare had written, on 01/10/2011 08:44 AM, the following:

Quoted 5 lines · Nishanth Menon
Quoted 3 lines

I think I should have done just CC alone. I missed the strip one. but are we interested in having CROSS_COMPILE? if yes, I can cleanup the patch and resubmit.

Quoted 7 lines
Quoted 5 lines

Well, you proposed it, so you should know if you are interested ;)

What's certain is that I won't apply the patch as is, so it indeed needs to be cleaned up and resubmitted if you want me to apply it.

Touché ;). will resubmit it :) thanks for the pointers in strip. I will try to ensure that we have just the ones we need.

You did not resubmit anything, and you just missed the train. If you want your patch in i2c-tools 3.1.1, please consider resubmitting with the required changes applied.

Signature · 1 line
Jean Delvare