Bug 47119 - sh-symbianelf: symbian-base.o won't build
Summary: sh-symbianelf: symbian-base.o won't build
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: build
Depends on:
Blocks: 47093
  Show dependency treegraph
 
Reported: 2010-12-29 15:30 UTC by Jorn Wolfgang Rennecke
Modified: 2011-04-05 15:11 UTC (History)
0 users

See Also:
Host: x86_64-pc-linux-gnu
Target: sh-symbianelf
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
tentative patch (1.51 KB, patch)
2010-12-31 19:51 UTC, Jorn Wolfgang Rennecke
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jorn Wolfgang Rennecke 2010-12-29 15:30:28 UTC
gcc -c  -DIN_GCC_FRONTEND -DIN_GCC_FRONTEND -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -Wold-style-definition -Wc++-compat -fno-common  -DHAVE_CONFIG_H -I. -I. -I../../../gcc/gcc -I../../../gcc/gcc/. -I../../../gcc/gcc/../include -I../../../gcc/gcc/../libcpp/include -I/opt/cfarm/mpc/include  -I../../../gcc/gcc/../libdecnumber -I../../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber    -I. -I. -I../../../gcc/gcc -I../../../gcc/gcc/. -I../../../gcc/gcc/../include -I../../../gcc/gcc/../libcpp/include -I/opt/cfarm/mpc/include  -I../../../gcc/gcc/../libdecnumber -I../../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber   ../../../gcc/gcc/config/sh/symbian-base.c
In file included from ../../../gcc/gcc/config/sh/symbian-base.c:27:0:
../../../gcc/gcc/rtl.h:22:9: error: attempt to use poisoned "GCC_RTL_H"
In file included from ../../../gcc/gcc/config/sh/symbian-base.c:28:0:
../../../gcc/gcc/output.h:588:50: error: ISO C forbids forward references to ‘enum’ types [-Werror=edantic]
../../../gcc/gcc/output.h:590:10: error: ‘enum machine_mode’ declared inside parameter list [-Werror]
../../../gcc/gcc/output.h:590:10: error: its scope is only this definition or declaration, which is probably not what you want [-Werror]
../../../gcc/gcc/output.h:627:50: error: ISO C forbids forward references to ‘enum’ types [-Werror=edantic]
../../../gcc/gcc/output.h:628:10: error: ‘enum machine_mode’ declared inside parameter list [-Werror]
../../../gcc/gcc/output.h:629:54: error: ISO C forbids forward references to ‘enum’ types [-Werror=edantic]
../../../gcc/gcc/output.h:630:7: error: ‘enum machine_mode’ declared inside parameter list [-Werror]
In file included from ../../../gcc/gcc/config/sh/symbian-base.c:31:0:
../../../gcc/gcc/expr.h:22:9: error: attempt to use poisoned "GCC_EXPR_H"
../../../gcc/gcc/config/sh/symbian-base.c: In function ‘sh_symbian_is_dllexported’:
../../../gcc/gcc/config/sh/symbian-base.c:70:12: error: identifier ‘class’ conflicts with C++ keyword [-Werror=c++-compat]
../../../gcc/gcc/config/sh/symbian-base.c:72:11: error: identifier ‘class’ conflicts with C++ keyword [-Werror=c++-compat]
../../../gcc/gcc/config/sh/symbian-base.c: In function ‘sh_symbian_mark_dllimport’:
../../../gcc/gcc/config/sh/symbian-base.c:104:3: error: implicit declaration of function ‘XEXP’ [-Werror=implicit-function-declaration]
../../../gcc/gcc/config/sh/symbian-base.c:104:11: error: assignment makes pointer from integer without a cast [-Werror]
../../../gcc/gcc/config/sh/symbian-base.c:105:3: error: implicit declaration of function ‘MEM_P’ [-Werror=implicit-function-declaration]
../../../gcc/gcc/config/sh/symbian-base.c:106:13: error: assignment makes pointer from integer without a cast [-Werror]
../../../gcc/gcc/config/sh/symbian-base.c:107:3: error: implicit declaration of function ‘GET_CODE’ [-Werror=implicit-function-declaration]
../../../gcc/gcc/config/sh/symbian-base.c:107:3: error: ‘SYMBOL_REF’ undeclared (first use in this function)
../../../gcc/gcc/config/sh/symbian-base.c:107:3: note: each undeclared identifier is reported only once for each function it appears in
../../../gcc/gcc/config/sh/symbian-base.c:108:3: error: implicit declaration of function ‘XSTR’ [-Werror=implicit-function-declaration]
../../../gcc/gcc/config/sh/symbian-base.c:108:11: error: assignment makes pointer from integer without a cast [-Werror]
../../../gcc/gcc/config/sh/symbian-base.c:132:7: error: implicit declaration of function ‘gen_rtx_SYMBOL_REF’ [-Werror=implicit-function-declaration]
../../../gcc/gcc/config/sh/symbian-base.c:132:14: error: assignment makes pointer from integer without a cast [-Werror]
../../../gcc/gcc/config/sh/symbian-base.c:133:13: error: lvalue required as left operand of assignment
../../../gcc/gcc/config/sh/symbian-base.c: In function ‘sh_symbian_mark_dllexport’:
../../../gcc/gcc/config/sh/symbian-base.c:148:11: error: assignment makes pointer from integer without a cast [-Werror]
../../../gcc/gcc/config/sh/symbian-base.c:150:13: error: assignment makes pointer from integer without a cast [-Werror]
../../../gcc/gcc/config/sh/symbian-base.c:151:3: error: ‘SYMBOL_REF’ undeclared (first use in this function)
../../../gcc/gcc/config/sh/symbian-base.c:152:11: error: assignment makes pointer from integer without a cast [-Werror]
../../../gcc/gcc/config/sh/symbian-base.c:179:32: error: lvalue required as left operand of assignment
../../../gcc/gcc/config/sh/symbian-base.c: At top level:
../../../gcc/gcc/config/sh/symbian-base.c:183:1: error: no previous prototype for ‘sh_symbian_encode_section_info’ [-Werror=missing-prototypes]
../../../gcc/gcc/config/sh/symbian-base.c: In function ‘sh_symbian_encode_section_info’:
../../../gcc/gcc/config/sh/symbian-base.c:199:27: error: ‘NULL_RTX’ undeclared (first use in this function)
../../../gcc/gcc/config/sh/symbian-base.c:202:58: error: ‘SYMBOL_REF’ undeclared (first use in this function)
../../../gcc/gcc/config/sh/symbian-base.c:203:58: error: passing argument 1 of ‘sh_symbian_is_dllimported_name’ makes pointer from integer without a cast [-Werror]
../../../gcc/gcc/config/sh/symbian-base.c:48:1: note: expected ‘const char *’ but argument is of type ‘int’
../../../gcc/gcc/config/sh/symbian-base.c:205:30: error: initialization makes pointer from integer without a cast [-Werror]
../../../gcc/gcc/config/sh/symbian-base.c:208:20: error: initialization makes pointer from integer without a cast [-Werror]
../../../gcc/gcc/config/sh/symbian-base.c:215:13: error: lvalue required as left operand of assignment
cc1: all warnings being treated as errors

make[2]: *** [symbian-base.o] Error 1
Comment 1 Jorn Wolfgang Rennecke 2010-12-31 19:51:25 UTC
Created attachment 22875 [details]
tentative patch

There are a lot more problems with this port.  Here is a patch that makes
the port sort-of build when using GCC as the build compiler; it uses the
weak attribute to work around some issues with having different target
hooks depending on the input language.

I suppose we'd need some serious infrastructure work to make this work
cleanly and portably.

OTOH, considering that the port has been this seriously broken in GCC 4.5
(e.g. look at the array syntax in sh_symbian_class_needs_attribute),
and no PR for this was filed against 4.5, I suppose we could consider this
port to have already been deprecated in 4.5, and just remove it.
Comment 2 jsm-csl@polyomino.org.uk 2010-12-31 20:03:27 UTC
On Fri, 31 Dec 2010, amylaar at gcc dot gnu.org wrote:

> There are a lot more problems with this port.  Here is a patch that makes
> the port sort-of build when using GCC as the build compiler; it uses the
> weak attribute to work around some issues with having different target
> hooks depending on the input language.

I objected to a previous patch version using the weak attribute and 
thought that a way was found at that point to do without it.  There's no 
way it should be needed on the host for anything reasonable in GCC - I 
don't know what this port is trying to do but there's bound to be a better 
way.  Split up objects as necessary and ensure that exactly one 
implementation of each function needed is linked into each compiler.  If 
the problem is generic functions calling C-family ones, use function 
pointers initialized at an appropriate point.  (REGISTER_TARGET_PRAGMAS is 
abused by ARM as a "C family initialization hook" though a separate hook 
would be better.)
Comment 3 Jorn Wolfgang Rennecke 2010-12-31 20:35:15 UTC
(In reply to comment #2)
 
> I objected to a previous patch version using the weak attribute and 
> thought that a way was found at that point to do without it.  There's no 
> way it should be needed on the host for anything reasonable in GCC 

I'm not saying that this is doing something reasonable - I just wanted to
know how much else it takes to get "make all-gcc" with --enable-werror-always
to succeed.

>- I 
> don't know what this port is trying to do but there's bound to be a better 
> way.  Split up objects as necessary and ensure that exactly one 
> implementation of each function needed is linked into each compiler.  If 
> the problem is generic functions calling C-family ones, use function 
> pointers initialized at an appropriate point.  (REGISTER_TARGET_PRAGMAS is 
> abused by ARM as a "C family initialization hook" though a separate hook 
> would be better.)

C and C++ frontends each have their own, different versions of these
functions, but then these functions area also wanted for linking the ada,
lto, and go compilers, and for collect2.

So one uniform "C family initialization hook" would not be enough.

Unless someone can re-unify the different implementations for the C language
family.  Maybe this will need some more language hooks.

But would that be effort well spent?  I.e. does anyone care about this port?
Comment 4 jsm-csl@polyomino.org.uk 2010-12-31 21:17:40 UTC
On Fri, 31 Dec 2010, amylaar at gcc dot gnu.org wrote:

> C and C++ frontends each have their own, different versions of these
> functions, but then these functions area also wanted for linking the ada,
> lto, and go compilers, and for collect2.
> 
> So one uniform "C family initialization hook" would not be enough.

The hook might call a function with different implementations for C and 
C++ if needed.
Comment 5 Joseph S. Myers 2011-04-05 15:11:16 UTC
sh-symbianelf support has been removed for 4.7.