Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaks compilation of other backends #1

Open
spth opened this issue Nov 5, 2019 · 3 comments
Open

Breaks compilation of other backends #1

spth opened this issue Nov 5, 2019 · 3 comments

Comments

@spth
Copy link

spth commented Nov 5, 2019

I tried to compile this fork of sdcc on my Debain GNU/Linux testing system. However, it seems the changes break the non-stm-backends. I had to use the workaround of disabling most non-stm8 ports:

./configure --disable-z80-port --disable-z180-port --disable-gbz80-port --disable-ez80_z80-port --disable-r2k-port --disable-r3ka-port --disable-tlcs90-port --disable-ds390-port --disable-mcs51-port --disable-ds400-port

The z80-related backends don't compile:

gcc -pipe -ggdb -g -Og -Wall -Wno-parentheses -I./.. -I.. -I. -I../.. -I./../../support/util -I.  -c -o main.o main.c
main.c: In function ‘do_pragma’:
main.c:316:34: error: assignment of read-only member ‘code_name’
  316 |         gbz80_port.mem.code_name = dbuf_detach (&buffer);
      |                                  ^
main.c: In function ‘_parseOptions’:
main.c:499:40: error: assignment of read-only member ‘code_name’
  499 |               gbz80_port.mem.code_name = dbuf_detach (&buffer);
      |                                        ^
main.c:513:40: error: assignment of read-only member ‘data_name’
  513 |               gbz80_port.mem.data_name = dbuf_detach (&buffer);

The ds390 library doesn't compile:

../../bin/sdcc -I../../device/include -I../../device/include/mcs51 -mds390 --nostdinc --std-c11 -c rand.c -o ds390/rand.rel
ds390/rand.asm:58: Error: <q> missing or improper operators, terminators, or delimiters
removing ds390/rand.rel

The mcs51 library doesn't compile:

../../bin/sdcc -I../../device/include -I../../device/include/mcs51 --model-huge --nostdinc --std-c11 -c _modulong.c -o huge/_modulong.rel
../../bin/sdcc -I../../device/include -I../../device/include/mcs51 --model-huge --nostdinc --std-c11 -c _divulong.c -o huge/_divulong.rel
make[4]: „huge/_mullong.rel“ ist bereits aktuell.
../../bin/sdcc -I../../device/include -I../../device/include/mcs51 --model-huge --nostdinc --std-c11 -c _rrulonglong.c -o huge/_rrulonglong.rel
../../bin/sdcc -I../../device/include -I../../device/include/mcs51 --model-huge --nostdinc --std-c11 -c _rrslonglong.c -o huge/_rrslonglong.rel
huge/_modulong.asm:39: Error: <q> missing or improper operators, terminators, or delimiters
removing huge/_modulong.rel
huge/_rrulonglong.asm:39: Error: <q> missing or improper operators, terminators, or delimiters
removing huge/_rrulonglong.rel
make[4]: *** [Makefile:665: huge/_modulong.rel] Fehler 1
make[4]: *** Es wird auf noch nicht beendete Prozesse gewartet....
make[4]: *** [Makefile:665: huge/_rrulonglong.rel] Fehler 1
huge/_divulong.asm:39: Error: <q> missing or improper operators, terminators, or delimiters
removing huge/_divulong.rel
make[4]: *** [Makefile:665: huge/_divulong.rel] Fehler 1
huge/_rrslonglong.asm:39: Error: <q> missing or improper operators, terminators, or delimiters
removing huge/_rrslonglong.rel

The ds400 library doesn't compile:

ds400/rand.asm:60: Error: <q> missing or improper operators, terminators, or delimiters

The pdk13, pdk14 and pdk15 libraries also fail to compile (but for some reason this does not stop the build process).

XaviDCR92 added a commit that referenced this issue Nov 6, 2019
Issue #1 was caused because code_name and data_name had been incorrectly
defined as const-qualified pointers, but this must be an exception for
the z80 backend, as stated by the comments.

Issue #2 has been solved by removing the --gas switch from SDCCmain.c,
renaming it to "--asm=" (as requested by PKK) and moved to STM8's main.c,
so the option is limited to those targets supporting it.

Issue #4 was because of SDCCglue.c, that generated local labels using
"!labeldef" instead of "!slabeldef", causing those __str_%d labels to be
printed as "__str_%d::" (the double colons stand for globa label according
to asxxx documentation) instead of "__str_%d":".

I ran the regression tests and most of them passed, but "wchar" returned another
"Multiple definition of..." error that I cannot explain so far. It is better than
nothing, though.
@XaviDCR92
Copy link
Owner

Building issues have been solved on commit cf1d3ae. However, I noticed all autoconf/aclocal/automake files are expecting automake version 2.64. This breaks the compilation process on my computer, where I am using automake 2.69. However, there is no reason why it should be fixed to a specific version as I could modify this restriction manually with no consequences.
@spth : why is automake version limited only to 2.64? Could we fix this so any version >= 2.64 is supported?

@spth
Copy link
Author

spth commented Nov 6, 2019

Thanks. I can confirm that SDCC compiles for me now with all ports enabled.

I am not that familiar with the build system, so I don't know why automake 2.64 was required. I guess it once really was required, but subsequent changes might have made this requiremetn obsolete.

@spth
Copy link
Author

spth commented Nov 7, 2019

However, there are still errors compiling the pdk15 library (and I see similar errors when trying to compile the pdk15 regression tests):

philipp@notebook5:/tmp/sdcc-gas/device/lib/pdk15$ make
../../../bin/sdcc -mpdk15 -I./../../include -I. --std-c11 -c ../time.c
time.asm:1464: Error: <q> missing or improper operators, terminators, or delimiters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants