Commit 4079221f authored by Ian Campbell's avatar Ian Campbell Committed by Siarhei Siamashka
Browse files

fel-to-spl-thunk.S: Only depend on binutils.



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.

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
directly to the cross-as.

There is no change to the resulting header file.
Signed-off-by: default avatarIan Campbell <ijc@hellion.org.uk>
Acked-by: default avatarSiarhei Siamashka <siarhei.siamashka@gmail.com>
parent 01f99728
......@@ -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
*/
/*************************************************************************/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment