This version of the patch just fixes up the comment to sound better.
Signed-off-by: John Arbuckle programmingkidx@gmail.com
Index: config/scripts/switch-arch =================================================================== --- config/scripts/switch-arch (revision 1335) +++ config/scripts/switch-arch (working copy) @@ -99,7 +99,8 @@
select_prefix() { - for TARGET in ${1}-unknown-linux-gnu- ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi- + # The user can specify the cross compiler like this: CROSS_COMPILER=ppc-elf- ./switch-arch ppc + for TARGET in ${1}-unknown-linux-gnu- ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi- $CROSS_COMPILER do if type ${TARGET}gcc > /dev/null 2>&1 then
select_prefix() {
- for TARGET in ${1}-unknown-linux-gnu- ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi-
- # The user can specify the cross compiler like this: CROSS_COMPILER=ppc-elf- ./switch-arch ppc
- for TARGET in ${1}-unknown-linux-gnu- ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi- $CROSS_COMPILER do if type ${TARGET}gcc > /dev/null 2>&1 then
If the user said what cross compiler they want, why not just trust him? Those lines are way too long btw.
Segher
On Apr 30, 2015, at 12:51 PM, Segher Boessenkool wrote:
select_prefix() {
- for TARGET in ${1}-unknown-linux-gnu- ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi-
- # The user can specify the cross compiler like this: CROSS_COMPILER=ppc-elf- ./switch-arch ppc
- for TARGET in ${1}-unknown-linux-gnu- ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi- $CROSS_COMPILER do if type ${TARGET}gcc > /dev/null 2>&1 then
If the user said what cross compiler they want, why not just trust him? Those lines are way too long btw.
That is how Mark prefers this change. I would like to see a -compiler_name option and just be the end of it. ./switch-arch ppc -compiler_name powerpc-elf-gcc-4.0.1 is how it would be used.
On Thu, Apr 30, 2015 at 01:00:34PM -0400, Programmingkid wrote:
select_prefix() {
- for TARGET in ${1}-unknown-linux-gnu- ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi-
- # The user can specify the cross compiler like this: CROSS_COMPILER=ppc-elf- ./switch-arch ppc
- for TARGET in ${1}-unknown-linux-gnu- ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi- $CROSS_COMPILER do if type ${TARGET}gcc > /dev/null 2>&1 then
If the user said what cross compiler they want, why not just trust him? Those lines are way too long btw.
That is how Mark prefers this change. I would like to see a -compiler_name option and just be the end of it. ./switch-arch ppc -compiler_name powerpc-elf-gcc-4.0.1 is how it would be used.
What I mean is, if the user has specified a CROSS_COMPILER, it is rather foolish to detect other toolchains (and prefer to use those, even).
The Linux kernel uses CROSS_COMPILE for this btw (note the lack of R).
Segher
On Apr 30, 2015, at 1:23 PM, Segher Boessenkool wrote:
On Thu, Apr 30, 2015 at 01:00:34PM -0400, Programmingkid wrote:
select_prefix() {
- for TARGET in ${1}-unknown-linux-gnu- ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi-
- # The user can specify the cross compiler like this: CROSS_COMPILER=ppc-elf- ./switch-arch ppc
- for TARGET in ${1}-unknown-linux-gnu- ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi- $CROSS_COMPILER do if type ${TARGET}gcc > /dev/null 2>&1 then
If the user said what cross compiler they want, why not just trust him? Those lines are way too long btw.
That is how Mark prefers this change. I would like to see a -compiler_name option and just be the end of it. ./switch-arch ppc -compiler_name powerpc-elf-gcc-4.0.1 is how it would be used.
What I mean is, if the user has specified a CROSS_COMPILER, it is rather foolish to detect other toolchains (and prefer to use those, even).
So you probably prefer the first version of this patch where the select-prefix() function would return before going thru the loop.
On Thu, Apr 30, 2015 at 12:23:42PM -0500, Segher Boessenkool wrote:
What I mean is, if the user has specified a CROSS_COMPILER, it is rather foolish to detect other toolchains (and prefer to use those, even).
The Linux kernel uses CROSS_COMPILE for this btw (note the lack of R).
Correct. I may have typoed in my suggestion for the name.
On Thu, Apr 30, 2015 at 11:51:27AM -0500, Segher Boessenkool wrote:
select_prefix() {
- for TARGET in ${1}-unknown-linux-gnu- ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi-
- # The user can specify the cross compiler like this: CROSS_COMPILER=ppc-elf- ./switch-arch ppc
- for TARGET in ${1}-unknown-linux-gnu- ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi- $CROSS_COMPILER do if type ${TARGET}gcc > /dev/null 2>&1 then
If the user said what cross compiler they want, why not just trust him? Those lines are way too long btw.
That makes sense, or at least try what they asked for first.