c/701: cross-compiler doesn't assemble

dean_copsey@hp.com dean_copsey@hp.com
Fri Oct 27 15:26:00 GMT 2000

>Number:         701
>Category:       c
>Synopsis:       cross-compiler doesn't assemble
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          support
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 27 15:26:00 PDT 2000
>Originator:     Dean Copsey
>Release:        gcc version 2.95.2 19991024 (release)
i686 running cygwin (dll 1.1.4) under Win2K; compiler build is cross compiler for powerpc-elf
gcc produces assembly but doesn't pass the assembly file to as.  My guess is that a <CR> is getting in the way:

Reading specs from /usr/local/lib/gcc-lib/ppc-elf/2.95.2/specs
gcc version 2.95.2 19991024 (release)
 /usr/local/lib/gcc-lib/ppc-elf/2.95.2/cpp.exe -lang-c -v -D__GNUC__=2 -D__GNUC_MINOR__=95 -DPPC -Dunix -D__svr4__ -D__PPC__ -D__unix__ -D__svr4__ -D__PPC -D__unix -Asystem(unix) -Asystem(svr4) -Acpu(powerpc) -Amachine(powerpc) -D__CHAR_UNSIGNED__ hello.c hello.i
GNU CPP version 2.95.2 19991024 (release) (PowerPC System V.4)
#include "..." search starts here:
#include <...> search starts here:
End of search list.
The following default directories have been omitted from the search path:
End of omitted list.
 /usr/local/lib/gcc-lib/ppc-elf/2.95.2/cc1.exe hello.i -quiet -dumpbase hello.c -version -o hello.s
GNU C version 2.95.2 19991024 (release) (ppc-elf) compiled by GNU C version 2.95.2 19991024 (release-2).

Assembler messages:
Error: Can't open ^M for reading.
^M: No such file or directory

Build binutils-2.10: ../binutils-2.10/configure --target=ppc-elf --program-prefix=ppc-elf- --with-newlib --with-headers=/usr/include --enable-languages=c,c++ 

Build gcc-2.95.2: ../gcc-2.95.2/configure <same options>

Start building newlib-1.8.2 (same options).  The first compile (.../newlib-1.8.2/newlib/libc/stdlib/__adjust.c) will fail with "Assembler messages" like above.
I'm assuming that the fix is to ensure the script (?) doesn't have a '\r' before '\n'.  This is default windows behaviour, and needs to be explicitly disabled by opening files as binary using fopen(output_file, wb) or _setmode(output_file, _O_BINARY).  The problem is, I don't know what generates the script, or alternatively, who reads it.
Content-Type: text/plain; name="hello.c"
Content-Disposition: inline; filename="hello.c"

#include <stdio.h>

main() {
	printf("Hello World!\n");
	return 0;

More information about the Gcc-bugs mailing list