pereraa / iphone-dev

Automatically exported from code.google.com/p/iphone-dev
0 stars 0 forks source link

LLVM-GCC build failure on Cygwin with missing terminating " error #191

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. build toolchain steps until 
make LLVM_VERSION_INFO=2.0-svn-iphone-dev-0.3-svn

What is the expected output? What do you see instead?
expected compilation LLVM-GCC complete, instead error message:

In file included from ../../../llvm-gcc-4.0-iphone/gcc/gcc.c:142:
./configargs.h:2: error: missing terminating " character
./configargs.h:3: error: missing terminating " character
./configargs.h:4: error: parse error before "static"
../../../llvm-gcc-4.0-iphone/gcc/gcc.c: In function `main':
../../../llvm-gcc-4.0-iphone/gcc/gcc.c:6423: warning: suggest explicit
braces to avoid ambiguous `else'
../../../llvm-gcc-4.0-iphone/gcc/gcc.c:6783: error: `thread_model'
undeclared (first use in this function)
../../../llvm-gcc-4.0-iphone/gcc/gcc.c:6783: error: (Each undeclared
identifier is reported only once
../../../llvm-gcc-4.0-iphone/gcc/gcc.c:6783: error: for each function it
appears in.)
make[1]: *** [gcc.o] Error 1
make[1]: Leaving directory
`/usr/local/iphone-dev/build/llvm-gcc-4.0-iphone/gcc'
make: *** [all-gcc] Error 2

What version of the product are you using? On what operating system?

winxp installed Cygwin:
$ uname -a
CYGWIN_NT-5.1 PICASSO 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin

Please provide any additional information below.

dynamically generated file contain wrong symbol "^M" at the end of text
constant and so causing compilation error.

example from configargs.h:
/* Generated automatically. */
static const char configuration_arguments[] =
"../../llvm-gcc-4.0-iphone/configure --enable-llvm=/usr/local/llvm-svn
--enable-languages=c,c++,objc,obj
-c++ --target=arm-apple-darwin --enable-sjlj-exceptions
--with-heavenly=/usr/local/share/iphone-filesystem
--with-as=/usr/local/bin/arm-apple-darwin-a
s --with-ld=/usr/local/bin/arm-apple-darwin-ld --enable-wchar_t=no^M";

issue causing generated file attached

Original issue reported on code.google.com by okoko...@gmail.com on 20 Oct 2009 at 9:25

Attachments:

GoogleCodeExporter commented 8 years ago
fixing issue by adding "^M" filter inside 
iphone-dev/llvm-gcc-4.0-iphone/configure.in
didn't helped (it's not working), the fix proposal was following:

before (line 81): sed -e 's,\$,$$,g' <<EOF_SED > conftestsed.out

after: sed -e 's/\x0D$//' -e 's,\$,$$,g' <<EOF_SED > conftestsed.out

Original comment by okoko...@gmail.com on 20 Oct 2009 at 9:31

GoogleCodeExporter commented 8 years ago
problem being temporary solved applying filter everywhere found population into
configargs.h file with a help of grep tool:

grep -iRn "cat > configargs.h" /usr/local/iphone-dev/

files affected are probably following two:

/usr/local/iphone-dev/llvm-gcc-4.0-iphone/gcc/configure:12767:cat > 
configargs.h <<EOF
/usr/local/iphone-dev/llvm-gcc-4.0-iphone/gcc/configure.ac:1530:cat > 
configargs.h <<EOF

fixes were provided in following block of code:

# Double all backslashes and backslash all quotes to turn
# gcc_config_arguments into a C string.
sed -e 's/\\/\\\\/g; s/"/\\"/g' <<EOF >conftest.out
$gcc_config_arguments
EOF
gcc_config_arguments_str=`cat conftest.out`
rm -f conftest.out

cat > configargs.h <<EOF
/* Generated automatically. */
static const char configuration_arguments[] = "$gcc_config_arguments_str";
static const char thread_model[] = "$thread_file";

original was:
sed -e 's/\\/\\\\/g; s/"/\\"/g' <<EOF >conftest.out

fixed with:
sed -e 's/\\/\\\\/g; s/"/\\"/g; s/\x0D//g' <<EOF >conftest.out

Original comment by ole2m...@gmail.com on 20 Oct 2009 at 4:07