RE: preprocessor/10743: Build error for CPP when building Cross compiler and host and target have diff character sets (i370)

"Ivan Warren" <[email protected]>
Newsgroups gmane.comp.gcc.bugs,gmane.comp.gcc.prs
Message-ID <000001c31eb2$464736b0$1411d0d4@pcisw>
Hello Neil,

I fetched the latest CVS (gcc_ss_20030519 I believe).. And there is still an
unresolved reference in cpplex.c when link editing cpp0 :

*** Compile log snippet : ****
gcc   -g -O2 -DIN_GCC -DCROSS_COMPILE  -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long
-fno-common   -DHAVE_CONFIG_H -DGENERATOR_FILE  -o fix-header fix-header.o \
c-incpath.o cppdefault.o scan-decls.o prefix.o scan.o libcpp.a
../libiberty/libiberty.a
libcpp.a(cpplex.o)(.text+0x1e0d): In function `cpp_interpret_charconst':
/data/unsaved/ivan/gcc-3.4-cvs/i370-ibm-mvs/gcc/../../gcc/gcc/cpplex.c:1614:
undefined reference to `mvs_map_char'
collect2: ld returned 1 exit status
make[1]: *** [fix-header] Error 1
make[1]: Leaving directory `/data/unsaved/ivan/gcc-3.4-cvs/i370-ibm-mvs/gcc'
make: *** [all-gcc] Error 2
*** End of snipper ****

My local workaround is to add a local definition for mvs_map_char in a file
(which returns the parameter), which gets linkedited with cpp0 (but not with
cc1).. I know this is a VERY DIRTY hack, so it's nothing but a local
workaround (i.e. it's not a fix !)

Mapping of MAP_CHAR to mvs_map_char is needed in cpplex.c (but only during
the compile) otherwise constants are in the wrong page code during a compile
(for example '%' gets mapped to 0x25(ascii) instead of 0x61(ebcdic) in the
assembly.. But it's irrelevant during the cpp stage (which generates on the
"host" system anyway, not the target system)..

The fix may not be trivial (mainly because the code page used for cpp0
output is the same as the host system (if I understand how it works
correctly) while the code page used for cc1 output is the one of the target
system)...

I believe (but again, I am a complete newbie in terms of compilers) that
this could be a general issue when dealing with cross compiles which bear
completelly different character sets.. And when the character conversion
code is held by the target backend (I hope I'm using the term backend
properly ! LOL)..

Anyways.. Thanks for the support ! And let me know if you need any extra
information (because what I am trying to do may not be trivial at all..)

Cheers,

--Ivan

> -----Original Message-----
> From: [email protected] [mailto:[email protected]] 
> Sent: Monday, May 19, 2003 10:20 PM
> To: [email protected]; [email protected]; 
> [email protected]; [email protected]
> Subject: Re: preprocessor/10743: Build error for CPP when 
> building Cross compiler and host and target have diff 
> character sets (i370)
> 
> 
> Synopsis: Build error for CPP when building Cross compiler 
> and host and target have diff character sets (i370)
> 
> State-Changed-From-To: open->closed
> State-Changed-By: neil
> State-Changed-When: Mon May 19 20:20:20 2003
> State-Changed-Why:
>     I believe this is fixed in 3.4.  If not, let me know and 
> I will reopen it.
> 
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p
r=10743
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.