[U-Boot] [PATCH v2 0/3] Adopt u-boot build to OS X

Latest changes to mkimage, Makefile and added proftool broke compilation on OS X. This series makes u-boot build clean again with some little adoptions.
Patch 'lib/rsa/rsa-sig.c: compile on OS X' supersedes http://patchwork.ozlabs.org/patch/255283/
Changes in v2: - remove REG_NOERROR instead of defining it conditionally (as Jeroen suggested)
Andreas Bießmann (3): lib/rsa/rsa-sig.c: compile on OS X tools/proftool: remove REG_NOERROR Makefile: fix readelf usage
Makefile | 2 +- lib/rsa/rsa-sign.c | 1 - tools/proftool.c | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-)

Interfaces exposed by error.h seems not to be used in rsa-sig.c, remove it. This also fixes an compile error on OS X:
---8<--- u-boot/lib/rsa/rsa-sign.c:23:19: error: error.h: No such file or directory --->8---
Signed-off-by: Andreas Bießmann andreas.devel@googlemail.com Tested-by: Lubomir Popov lpopov@mm-sol.com --- Changes in v2: None
lib/rsa/rsa-sign.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/lib/rsa/rsa-sign.c b/lib/rsa/rsa-sign.c index a75ae24..e30d8ca 100644 --- a/lib/rsa/rsa-sign.c +++ b/lib/rsa/rsa-sign.c @@ -20,7 +20,6 @@ #include "mkimage.h" #include <stdio.h> #include <string.h> -#include <error.h> #include <image.h> #include <time.h> #include <openssl/rsa.h>

Remove non portable usage of REG_NOERROR. BSD (like OS X) variants of regex.h do not declare REG_NOERROR, even GNU regex(3) do mention REG_NOERROR, just remove it.
Signed-off-by: Andreas Bießmann andreas.devel@googlemail.com --- Changes in v2: - remove REG_NOERROR instead of defining it conditionally (as Jeroen suggested)
tools/proftool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/proftool.c b/tools/proftool.c index a48ed28..aa05e77 100644 --- a/tools/proftool.c +++ b/tools/proftool.c @@ -333,7 +333,7 @@ static void check_trace_config_line(struct trace_configline_info *item) if (err == REG_NOMATCH) continue;
- if (err != REG_NOERROR) { + if (err) { regex_report_error(&item->regex, err, "match", item->name); break;

Hello Andreas,
On 07/02/2013 08:37 AM, Andreas Bießmann wrote:
Remove non portable usage of REG_NOERROR. BSD (like OS X) variants of regex.h do not declare REG_NOERROR, even GNU regex(3) do mention REG_NOERROR, just remove it.
^ does _not_
Perhaps Tom can amend it while applying. Anyway ..
Acked-by: Jeroen Hofstee jeroen@myspectrum.nl
And compile tested on FreeBSD (the 3 of them).
Regards, Jeroen

On Tue, Jul 2, 2013 at 3:37 PM, Andreas Bießmann < andreas.devel@googlemail.com> wrote:
Remove non portable usage of REG_NOERROR. BSD (like OS X) variants of regex.h do not declare REG_NOERROR, even GNU regex(3) do mention REG_NOERROR, just remove it.
Signed-off-by: Andreas Bießmann andreas.devel@googlemail.com
Reviewed-by: Simon Glass sjg@chromium.org

Some OS (like OS X) do not provide a generic readelf. We should enforce to use the toochain provided readelf instead, to do so use $(CROSS_COMPILE)readelf.
Signed-off-by: Andreas Bießmann andreas.devel@googlemail.com Tested-by: Lubomir Popov lpopov@mm-sol.com --- Changes in v2: None
Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile index ba1c10b..446c2f8 100644 --- a/Makefile +++ b/Makefile @@ -747,7 +747,7 @@ endif # config.mk # ARM relocations should all be R_ARM_RELATIVE. checkarmreloc: $(obj)u-boot @if test "R_ARM_RELATIVE" != \ - "`readelf -r $< | cut -d ' ' -f 4 | grep R_ARM | sort -u`"; \ + "`$(CROSS_COMPILE)readelf -r $< | cut -d ' ' -f 4 | grep R_ARM | sort -u`"; \ then echo "$< contains relocations other than \ R_ARM_RELATIVE"; false; fi

On Tue, Jul 02, 2013 at 08:37:34AM +0200, Andreas Bie??mann wrote:
Latest changes to mkimage, Makefile and added proftool broke compilation on OS X. This series makes u-boot build clean again with some little adoptions.
Patch 'lib/rsa/rsa-sig.c: compile on OS X' supersedes http://patchwork.ozlabs.org/patch/255283/
Changes in v2:
- remove REG_NOERROR instead of defining it conditionally (as Jeroen suggested)
Andreas Bie??mann (3): lib/rsa/rsa-sig.c: compile on OS X tools/proftool: remove REG_NOERROR Makefile: fix readelf usage
Makefile | 2 +- lib/rsa/rsa-sign.c | 1 - tools/proftool.c | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-)
Applied to u-boot/master, with the reword noted by Jeroen in 2/3, thanks!
participants (4)
-
Andreas Bießmann
-
Jeroen Hofstee
-
Simon Glass
-
Tom Rini