On Tue, 4 Aug 2015 20:01:39 +0100
Ian Campbell <[email protected]> wrote:
> A cross-binutils is generally a bit easier to get hold of, and in particular
> binutils-none-eabi (and binutils-arm-linux-gnueabi{,hf}) are available in
> Debian Jessie while the equivalent cross gcc is not.
Just curious. How does one normally build U-Boot or kernel for ARM
devices in Debian Jessie?
> The only reason gcc/cpp are required are to strip the embedded Ruby code out
> before handing to the assembler, we can achieve the same by opening a
> multiline
> comment around the ruby instead. Care needs to be taken not to close the
> comment prematurely hence "*/" is written in the one place it is used as
> "\x2a/" (i.e. encoding the * in hex). Having done this we can pass the .S file
We could probably do this even without relying on magic ASCII numbers.
Using something like printf("%s%s", "*", "/"). But since I'm not aware
of any relevant non-ASCII compatible system, either way is fine.
> directly to the cross-as.
>
> There is no change to the resulting header file.
>
> Signed-off-by: Ian Campbell <[email protected]>
> ---
> fel-to-spl-thunk.S | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/fel-to-spl-thunk.S b/fel-to-spl-thunk.S
> index 93350b3..08c7423 100644
> --- a/fel-to-spl-thunk.S
> +++ b/fel-to-spl-thunk.S
> @@ -25,7 +25,12 @@
> /* Usage instructions: "ruby -x fel-to-spl-thunk.S > fel-to-spl-thunk.h" */
> /*************************************************************************/
>
> -#if 0
> +/* Open a comment for gas.
> +
> + Do not close the comment until after the Ruby code terminator (__END__).
> + Write the '*' '/' sequence of characters as "\x2a/" in string literals to
> + avoid doing so.
> +
> #!/usr/bin/env ruby
>
> def tool_exists(tool_name)
> @@ -40,19 +45,19 @@ toolchains = [
> "armv7a-hardfloat-linux-gnueabi-",
> ]
>
> -toolchain = toolchains.find { |toolchain| tool_exists("#{toolchain}gcc") }
> +toolchain = toolchains.find { |toolchain| tool_exists("#{toolchain}as") }
> abort "Can't find any ARM crosscompiler\n" unless toolchain
>
> -system("#{toolchain}gcc -o #{$PROGRAM_NAME}.o -c #{$PROGRAM_NAME}")
> +system("#{toolchain}as -o #{$PROGRAM_NAME}.o #{$PROGRAM_NAME}")
> exit($?.to_i) if $?.to_i != 0
>
> `#{toolchain}objdump -d #{$PROGRAM_NAME}.o`.each_line {|l|
> next unless l =~ /(\h+)\:\s+(\h+)\s+(\S+)\s+([^;]*)/
> - printf("\t0x%s, /* %8s: %-10s %-28s */\n", $2, $1, $3, $4.strip)
> + printf("\t0x%s, /* %8s: %-10s %-28s \x2a/\n", $2, $1, $3, $4.strip)
> }
>
> __END__
> -#endif
> +*/
>
> /*************************************************************************/
>
Acked-by: Siarhei Siamashka <[email protected]>
--
Best regards,
Siarhei Siamashka
--
You received this message because you are subscribed to the Google Groups
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.