I'm trying to update OpenBSD's sdcc package from 2.8.0 to 3.2.0. Attached is a patch against OpenBSD's ports tree for reference--to use it on an OpenBSD -current system with ports tree in /usr/ports, run "cd /usr/ports/devel/sdcc && patch < sdcc.diff && make build".
The build fails here:
libtool: compile: cc -DHAVE_CONFIG_H -I. -DNETBSD_CORE -I. -I. -I./../include -DHAVE_bfd_elf64_x86_64_vec -DHAVE_bfd_elf32_i386_vec -DHAVE_i386netbsd_vec -DHAVE_i386coff_vec -DHAVE_i386pei_vec -DHAVE_x86_64pei_vec -DHAVE_bfd_elf64_l1om_vec -DHAVE_bfd_elf64_k1om_vec -DHAVE_bfd_elf64_little_generic_vec -DHAVE_bfd_elf64_big_generic_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -DBINDIR=\"/usr/local/bin\" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -O2 -pipe -g -MT peigen.lo -MD -MP -MF .deps/peigen.Tpo -c peigen.c -o peigen.o
cc1: warnings being treated as errors
peigen.c: In function '_bfd_pei_swap_aux_in':
peigen.c:252: warning: array size (14) smaller than bound length (18)
peigen.c:252: warning: array size (14) smaller than bound length (18)
peigen.c:252: warning: array size (14) smaller than bound length (18)
peigen.c:252: warning: array size (14) smaller than bound length (18)
peigen.c: In function '_bfd_pei_swap_aux_out':
peigen.c:326: warning: array size (14) smaller than bound length (18)
peigen.c:326: warning: array size (14) smaller than bound length (18)
peigen.c:326: warning: array size (14) smaller than bound length (18)
peigen.c:326: warning: array size (14) smaller than bound length (18)
gmake[5]: *** [peigen.lo] Error 1
Using gcc version 4.2.1, the system default.
Hi Anthony,
sdcc developers do not maintain the OpenBSD sdcc port. You should send this patch to OpenBSD sdcc port maintainers.
But I did an other thing: in svn revision #8525 I replaced all remaining #!/bin/bash with #!/bin/sh, so the sdcc build should not depend on bash any more.
Borut
Thanks for the reply, Borut.
In fact, I am an OpenBSD packager. The diff was just for reference, in case someone wanted to reproduce my build. The real reason for this bug report is the compile error mentioned above. This is a bug in sdcc (since sdcc explicitly enables -Werror in builds, the code should compile with no warnings). Please reopen this bug.
I reopened the bug.
Sorry for my misunderstanding!
Borut
I don't know whether this is a compiler or binutils problem: we are compiling binutils on several platforms/compilers (see sdcc snapshot builds), but none of them has this problem...
SDCC 3.2.0 sdbinutils is actually stripped down binutils 2.22, so if it turns out that this is rally a binutils problem, it should be reported to binutils developers.
To work around the sdcc problem I suggest the following:
Try to compile sdbinutils without -Werror flag so that warnings will not be treated as errors. This might also be the final solution unless you try to replace the sdcc 3.2.0 support/sdbinutils directory with one from SDCC svn HEAD. This one is updated to binutils 2.23 and all unnecessary modules are excluded, including the offending peigen.c (actually peXXigen.c). So it might happen that it compiles without errors even with the -Werror flag.
Borut
Hello Anthony,
Without asking you to create and distribute a package from our svn HEAD, can you please try to reproduce the problem with the HEAD? If it is fixed can you please report that back so we can close this one before any new release?
Maarten
I have not seen such problems when compiling current svn on OpenBSD 5.5.
Philipp