Skip to contentSkip to conversation

scripts: use CROSS_COMPILE environment variable

PATCH New Stefan Agner 2 participants 7 messages Mar 2, 2018 – Mar 23, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts: use CROSS_COMPILE environment variable

From: Stefan Agner <[email protected]>

Make sure we use objcopy from the cross compiler toolchain.

---
 scripts/get_default_envs.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/get_default_envs.sh +2 -1
index 7955db60e5..84e9f51695 100755
@@ -24,7 +24,8 @@ cp ${env_obj_file_path} ${ENV_OBJ_FILE_COPY}
 
 # NOTE: objcopy saves its output to file passed in
 # (copy_env_common.o in this case)
-objcopy -O binary -j ".rodata.default_environment" ${ENV_OBJ_FILE_COPY}
+${CROSS_COMPILE}objcopy -O binary -j ".rodata.default_environment" \
+	${ENV_OBJ_FILE_COPY}
 
 # Replace default '\0' with '\n' and sort entries
 tr '\0' '\n' < ${ENV_OBJ_FILE_COPY} | sort -u
Signature · 1 line
2.16.2
#1 lore raw

PATCH 1/1 scripts: use CROSS_COMPILE environment variable

Hi Stefan,

Quoted 20 lines

From: Stefan Agner <[email protected]>

Make sure we use objcopy from the cross compiler toolchain.

---
 scripts/get_default_envs.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/get_default_envs.sh +0 -1
index 7955db60e5..84e9f51695 100755
@@ -24,7 +24,8 @@ cp ${env_obj_file_path} ${ENV_OBJ_FILE_COPY}
 
 # NOTE: objcopy saves its output to file passed in
 # (copy_env_common.o in this case)
-objcopy -O binary -j ".rodata.default_environment"

${ENV_OBJ_FILE_COPY} +${CROSS_COMPILE}objcopy -O binary -j ".rodata.default_environment" \

scripts/get_default_envs.sh cp ${env_obj_file_path} ${ENV_OBJ_FILE_COPY} · line 28

Quoted 1 line
scripts/get_default_envs.sh +1 -0
+	${ENV_OBJ_FILE_COPY}

Stefan, could you check if this is not already solved in newest mainline?

It seems like this is v2 or v1 of the patch. The v3 was finally pulled to main line:

+${OBJCOPY} -O binary -j ".rodata.default_environment" ${ENV_OBJ_FILE_COPY}

Quoted 3 lines

# Replace default '\0' with '\n' and sort entries tr '\0' '\n' < ${ENV_OBJ_FILE_COPY} | sort -u

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected] -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180302/5cb5a050/attachment.sig>

#2 lore raw

PATCH 1/1 scripts: use CROSS_COMPILE environment variable

Hi Lukasz,

Quoted 27 lines · Lukasz Majewski

Hi Stefan,

Quoted 20 lines

From: Stefan Agner <[email protected]>

Make sure we use objcopy from the cross compiler toolchain.

---
 scripts/get_default_envs.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/get_default_envs.sh +0 -1
index 7955db60e5..84e9f51695 100755
@@ -24,7 +24,8 @@ cp ${env_obj_file_path} ${ENV_OBJ_FILE_COPY}
 
 # NOTE: objcopy saves its output to file passed in
 # (copy_env_common.o in this case)
-objcopy -O binary -j ".rodata.default_environment"

${ENV_OBJ_FILE_COPY} +${CROSS_COMPILE}objcopy -O binary -j ".rodata.default_environment" \

scripts/get_default_envs.sh cp ${env_obj_file_path} ${ENV_OBJ_FILE_COPY} · line 28

Quoted 1 line
scripts/get_default_envs.sh +1 -0
+	${ENV_OBJ_FILE_COPY}

Stefan, could you check if this is not already solved in newest mainline?

Quoted 6 lines

It seems like this is v2 or v1 of the patch. The v3 was finally pulled to main line:

+${OBJCOPY} -O binary -j ".rodata.default_environment" ${ENV_OBJ_FILE_COPY}

Oh I see there is a patch on master yes.

It seems not to work here though:

$ ./scripts/get_default_envs.sh .
arm-linux-gnueabihf-objcopy:stPZVLWM: Invalid operation

Need to look closer

--
Stefan

Quoted 16 lines
Quoted 3 lines

# Replace default '\0' with '\n' and sort entries tr '\0' '\n' < ${ENV_OBJ_FILE_COPY} | sort -u

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de

#3 lore raw

PATCH 1/1 scripts: use CROSS_COMPILE environment variable

In reply to Lukasz Majewski
Quoted 27 lines · Lukasz Majewski

Hi Stefan,

Quoted 20 lines

From: Stefan Agner <[email protected]>

Make sure we use objcopy from the cross compiler toolchain.

---
 scripts/get_default_envs.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/get_default_envs.sh +0 -1
index 7955db60e5..84e9f51695 100755
@@ -24,7 +24,8 @@ cp ${env_obj_file_path} ${ENV_OBJ_FILE_COPY}
 
 # NOTE: objcopy saves its output to file passed in
 # (copy_env_common.o in this case)
-objcopy -O binary -j ".rodata.default_environment"

${ENV_OBJ_FILE_COPY} +${CROSS_COMPILE}objcopy -O binary -j ".rodata.default_environment" \

scripts/get_default_envs.sh cp ${env_obj_file_path} ${ENV_OBJ_FILE_COPY} · line 28

Quoted 1 line
scripts/get_default_envs.sh +1 -0
+	${ENV_OBJ_FILE_COPY}

Stefan, could you check if this is not already solved in newest mainline?

Quoted 6 lines

It seems like this is v2 or v1 of the patch. The v3 was finally pulled to main line:

+${OBJCOPY} -O binary -j ".rodata.default_environment" ${ENV_OBJ_FILE_COPY}

Tested again with vanilla mainline, and the scripts works indeed fine and does exactly what I tried to achieve. Thanks Lukasz.

I did backport it, but had to set the object file back to env_common.o for our case.

So disregard this patch.

--
Stefan

Quoted 16 lines
Quoted 3 lines

# Replace default '\0' with '\n' and sort entries tr '\0' '\n' < ${ENV_OBJ_FILE_COPY} | sort -u

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de

#4 lore raw

PATCH 1/1 scripts: use CROSS_COMPILE environment variable

Hi Stefan,

Quoted 31 lines · Lukasz Majewski
Quoted 30 lines

Hi Stefan,

Quoted 20 lines

From: Stefan Agner <[email protected]>

Make sure we use objcopy from the cross compiler toolchain.

---
 scripts/get_default_envs.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/scripts/get_default_envs.sh index 7955db60e5..84e9f51695 100755

scripts/get_default_envs.sh +0 -1
@@ -24,7 +24,8 @@ cp ${env_obj_file_path} ${ENV_OBJ_FILE_COPY}
 
 # NOTE: objcopy saves its output to file passed in
 # (copy_env_common.o in this case)
-objcopy -O binary -j ".rodata.default_environment"

${ENV_OBJ_FILE_COPY} +${CROSS_COMPILE}objcopy -O binary -j ".rodata.default_environment" \

scripts/get_default_envs.sh cp ${env_obj_file_path} ${ENV_OBJ_FILE_COPY} · line 28

Quoted 1 line
scripts/get_default_envs.sh +1 -0
+	${ENV_OBJ_FILE_COPY}  

Stefan, could you check if this is not already solved in newest mainline?

It seems like this is v2 or v1 of the patch. The v3 was finally pulled to main line:

Quoted 6 lines
Quoted 3 lines

+${OBJCOPY} -O binary -j ".rodata.default_environment" ${ENV_OBJ_FILE_COPY}

Tested again with vanilla mainline, and the scripts works indeed fine and does exactly what I tried to achieve. Thanks Lukasz.

Happy to could help.

I've also tested this patch with OE|Yocto u-boot (for 2.3.3) recipe to generate images with primary and redundant envs.

I will try to upstream it, so creating env images would be easy.

Quoted 5 lines

I did backport it, but had to set the object file back to env_common.o for our case.

So disregard this patch.

Ok.

Quoted 21 lines

--
Stefan

Quoted 17 lines
Quoted 3 lines

# Replace default '\0' with '\n' and sort entries tr '\0' '\n' < ${ENV_OBJ_FILE_COPY} | sort -u

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang
Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email:
wd at denx.de

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180303/03a03592/attachment.sig>

#5 lore raw

PATCH 1/1 scripts: use CROSS_COMPILE environment variable

Quoted 40 lines · Lukasz Majewski

Hi Stefan,

Quoted 31 lines · Lukasz Majewski
Quoted 30 lines

Hi Stefan,

Quoted 20 lines

From: Stefan Agner <[email protected]>

Make sure we use objcopy from the cross compiler toolchain.

---
 scripts/get_default_envs.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/scripts/get_default_envs.sh index 7955db60e5..84e9f51695 100755

scripts/get_default_envs.sh +0 -1
@@ -24,7 +24,8 @@ cp ${env_obj_file_path} ${ENV_OBJ_FILE_COPY}
 
 # NOTE: objcopy saves its output to file passed in
 # (copy_env_common.o in this case)
-objcopy -O binary -j ".rodata.default_environment"

${ENV_OBJ_FILE_COPY} +${CROSS_COMPILE}objcopy -O binary -j ".rodata.default_environment" \

scripts/get_default_envs.sh cp ${env_obj_file_path} ${ENV_OBJ_FILE_COPY} · line 28

Quoted 1 line
scripts/get_default_envs.sh +1 -0
+	${ENV_OBJ_FILE_COPY}

Stefan, could you check if this is not already solved in newest mainline?

It seems like this is v2 or v1 of the patch. The v3 was finally pulled to main line:

Quoted 6 lines
Quoted 3 lines

+${OBJCOPY} -O binary -j ".rodata.default_environment" ${ENV_OBJ_FILE_COPY}

Tested again with vanilla mainline, and the scripts works indeed fine and does exactly what I tried to achieve. Thanks Lukasz.

Quoted 7 lines

Happy to could help.

I've also tested this patch with OE|Yocto u-boot (for 2.3.3) recipe to generate images with primary and redundant envs.

I will try to upstream it, so creating env images would be easy.

That sounds interesting.

Did you already send a patch for this? Do you happen to have a link/patchfile you could share?

--
Stefan

Quoted 42 lines
Quoted 5 lines

I did backport it, but had to set the object file back to env_common.o for our case.

So disregard this patch.

Ok.

Quoted 21 lines

--
Stefan

Quoted 17 lines
Quoted 3 lines

# Replace default '\0' with '\n' and sort entries tr '\0' '\n' < ${ENV_OBJ_FILE_COPY} | sort -u

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang
Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email:
wd at denx.de

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de

#6 lore raw

PATCH 1/1 scripts: use CROSS_COMPILE environment variable

Quoted 46 lines · On Fri, 23 Mar 2018 16:30:56 +0100 Stefan Agner <[email protected]> wrote:
Quoted 45 lines · Lukasz Majewski

Hi Stefan,

Quoted 31 lines · Lukasz Majewski
Quoted 30 lines

Hi Stefan,

Quoted 20 lines

From: Stefan Agner <[email protected]>

Make sure we use objcopy from the cross compiler toolchain.

---
 scripts/get_default_envs.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/scripts/get_default_envs.sh index 7955db60e5..84e9f51695 100755 --- a/scripts/get_default_envs.sh
+++ b/scripts/get_default_envs.sh

scripts/get_default_envs.sh +0 -1
@@ -24,7 +24,8 @@ cp ${env_obj_file_path} ${ENV_OBJ_FILE_COPY}
 
 # NOTE: objcopy saves its output to file passed in
 # (copy_env_common.o in this case)
-objcopy -O binary -j ".rodata.default_environment"

${ENV_OBJ_FILE_COPY} +${CROSS_COMPILE}objcopy -O binary -j ".rodata.default_environment" \

scripts/get_default_envs.sh cp ${env_obj_file_path} ${ENV_OBJ_FILE_COPY} · line 28

Quoted 1 line
scripts/get_default_envs.sh +1 -0
+	${ENV_OBJ_FILE_COPY}  

Stefan, could you check if this is not already solved in newest mainline?

It seems like this is v2 or v1 of the patch. The v3 was finally pulled to main line:

Quoted 6 lines
Quoted 3 lines

+${OBJCOPY} -O binary -j ".rodata.default_environment" ${ENV_OBJ_FILE_COPY}

Tested again with vanilla mainline, and the scripts works indeed fine and does exactly what I tried to achieve. Thanks Lukasz.

Happy to could help.

I've also tested this patch with OE|Yocto u-boot (for 2.3.3) recipe to generate images with primary and redundant envs.

Quoted 7 lines
Quoted 2 lines

I will try to upstream it, so creating env images would be easy.

That sounds interesting.

Did you already send a patch for this? Do you happen to have a link/patchfile you could share?

Unfortunately not...... It is not in a shape to be sent to OE mailing list.

Quoted 47 lines

--
Stefan

Quoted 43 lines
Quoted 5 lines

I did backport it, but had to set the object file back to env_common.o for our case.

So disregard this patch.

Ok.

Quoted 21 lines

--
Stefan

Quoted 17 lines
Quoted 3 lines

# Replace default '\0' with '\n' and sort entries tr '\0' '\n' < ${ENV_OBJ_FILE_COPY} | sort -u

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang
Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax:
(+49)-8142-66989-80 Email: wd at denx.de

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang
Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email:
wd at denx.de

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180323/a73071c6/attachment.sig>