From 8bc60e47490abd415a3906347f1dc71707320360 Mon Sep 17 00:00:00 2001 From: Johann Date: Mon, 12 Dec 2011 17:14:03 -0800 Subject: Fix iOS conversion script Mach-O prefixes function calls with _ Change-Id: I778c2ab91266887731a6a0316b42af7641826da4 --- build/make/ads2gas_apple.pl | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'build/make/ads2gas_apple.pl') diff --git a/build/make/ads2gas_apple.pl b/build/make/ads2gas_apple.pl index 78f4a97f5..2af6116d5 100755 --- a/build/make/ads2gas_apple.pl +++ b/build/make/ads2gas_apple.pl @@ -30,6 +30,8 @@ my @mapping_list = ("\$0", "\$1", "\$2", "\$3", "\$4", "\$5", "\$6", "\$7", "\$8 my @incoming_array; +my @imported_functions; + # Perl trim function to remove whitespace from the start and end of the string sub trim($) { @@ -132,7 +134,18 @@ while () # Make function visible to linker, and make additional symbol with # prepended underscore s/EXPORT\s+\|([\$\w]*)\|/.globl _$1\n\t.globl $1/; - s/IMPORT\s+\|([\$\w]*)\|/.globl $1/; + + # Prepend imported functions with _ + if (s/IMPORT\s+\|([\$\w]*)\|/.globl $1/) + { + $function = trim($1); + push(@imported_functions, $function); + } + + foreach $function (@imported_functions) + { + s/$function/_$function/; + } # No vertical bars required; make additional symbol with prepended # underscore -- cgit v1.2.3