GCC version > 4.4

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

GCC version > 4.4

NorbertHartl

I tried to compile the vm with a newer gcc than 4.4. It didn't work with 4.9 and I tested 4.8 and 4.7 which do not work either. The last one I was successful was 4.4. Trying to compile it gives an error about conflicting types. Looking into brought to the signature of procedures in cogit.c. Here we have something like

static sqInt abstractRegisterForConcreteRegister(AbstractInstruction * self_in_abstractRegisterForConcreteRegister, sqInt reg) NoDbgRegParms;

and the definition is

static sqInt
abstractRegisterForConcreteRegister(AbstractInstruction * self_in_abstractRegisterForConcreteRegister, sqInt reg)
{

It seems that the NoDbgRegParms is changing the game. So I assume the signatures have to be exactly the same. Putting NoDbgRegParms after the parentheses in the definition does not work. So I changed both to have it in front like

NoDbgRegParms static sqInt abstractRegisterForConcreteRegister(AbstractInstruction * self_in_abstractRegisterForConcreteRegister, sqInt reg);

and

NoDbgRegParms static sqInt
abstractRegisterForConcreteRegister(AbstractInstruction * self_in_abstractRegisterForConcreteRegister, sqInt reg)
{

and this compiles for me. So two questions:

- am I write with my assumption and is the change a valid solution for the problem
- if yes will you change it or should I give it a try. It will take some time for me to figure out where that is exactly in the VMMaker code and I assume that it is a no-brainer for someone developing actively with VMMaker

regards,

Norbert
Reply | Threaded
Open this post in threaded view
|

Re: GCC version > 4.4

EstebanLM

I’m using 4.6.3 in an ubuntu 12.04 and works fine for me.

Esteban

> On 12 Dec 2014, at 14:22, Norbert Hartl <[hidden email]> wrote:
>
>
> I tried to compile the vm with a newer gcc than 4.4. It didn't work with 4.9 and I tested 4.8 and 4.7 which do not work either. The last one I was successful was 4.4. Trying to compile it gives an error about conflicting types. Looking into brought to the signature of procedures in cogit.c. Here we have something like
>
> static sqInt abstractRegisterForConcreteRegister(AbstractInstruction * self_in_abstractRegisterForConcreteRegister, sqInt reg) NoDbgRegParms;
>
> and the definition is
>
> static sqInt
> abstractRegisterForConcreteRegister(AbstractInstruction * self_in_abstractRegisterForConcreteRegister, sqInt reg)
> {
>
> It seems that the NoDbgRegParms is changing the game. So I assume the signatures have to be exactly the same. Putting NoDbgRegParms after the parentheses in the definition does not work. So I changed both to have it in front like
>
> NoDbgRegParms static sqInt abstractRegisterForConcreteRegister(AbstractInstruction * self_in_abstractRegisterForConcreteRegister, sqInt reg);
>
> and
>
> NoDbgRegParms static sqInt
> abstractRegisterForConcreteRegister(AbstractInstruction * self_in_abstractRegisterForConcreteRegister, sqInt reg)
> {
>
> and this compiles for me. So two questions:
>
> - am I write with my assumption and is the change a valid solution for the problem
> - if yes will you change it or should I give it a try. It will take some time for me to figure out where that is exactly in the VMMaker code and I assume that it is a no-brainer for someone developing actively with VMMaker
>
> regards,
>
> Norbert

Reply | Threaded
Open this post in threaded view
|

Re: GCC version > 4.4

Tobias Pape
In reply to this post by NorbertHartl

Hi Norbert
On 12.12.2014, at 14:22, Norbert Hartl <[hidden email]> wrote:

>
> I tried to compile the vm with a newer gcc than 4.4. It didn't work with 4.9 and I tested 4.8 and 4.7 which do not work either. The last one I was successful was 4.4. Trying to compile it gives an error about conflicting types. Looking into brought to the signature of procedures in cogit.c. Here we have something like
>
> static sqInt abstractRegisterForConcreteRegister(AbstractInstruction * self_in_abstractRegisterForConcreteRegister, sqInt reg) NoDbgRegParms;

I recall timothy having the same problem during CMakification.
So maybe he has more information (or the information that gcc >4.4 does not
work helps him)

Best
        -Tobias


>
> and the definition is
>
> static sqInt
> abstractRegisterForConcreteRegister(AbstractInstruction * self_in_abstractRegisterForConcreteRegister, sqInt reg)
> {
>
> It seems that the NoDbgRegParms is changing the game. So I assume the signatures have to be exactly the same. Putting NoDbgRegParms after the parentheses in the definition does not work. So I changed both to have it in front like
>
> NoDbgRegParms static sqInt abstractRegisterForConcreteRegister(AbstractInstruction * self_in_abstractRegisterForConcreteRegister, sqInt reg);
>
> and
>
> NoDbgRegParms static sqInt
> abstractRegisterForConcreteRegister(AbstractInstruction * self_in_abstractRegisterForConcreteRegister, sqInt reg)
> {
>
> and this compiles for me. So two questions:
>
> - am I write with my assumption and is the change a valid solution for the problem
> - if yes will you change it or should I give it a try. It will take some time for me to figure out where that is exactly in the VMMaker code and I assume that it is a no-brainer for someone developing actively with VMMaker
>
> regards,
>
> Norbert


Reply | Threaded
Open this post in threaded view
|

Re: GCC version > 4.4

NorbertHartl
In reply to this post by EstebanLM

Yep, than try 4.7 or above. I can't tell exactly which version starts to complain because my linux systems have only 4.4, 4.7 4.8 and 4.9 and I can that 4.7 is not working

Norbert

> Am 12.12.2014 um 14:28 schrieb Esteban Lorenzano <[hidden email]>:
>
>
> I’m using 4.6.3 in an ubuntu 12.04 and works fine for me.
>
> Esteban
>
>> On 12 Dec 2014, at 14:22, Norbert Hartl <[hidden email]> wrote:
>>
>>
>> I tried to compile the vm with a newer gcc than 4.4. It didn't work with 4.9 and I tested 4.8 and 4.7 which do not work either. The last one I was successful was 4.4. Trying to compile it gives an error about conflicting types. Looking into brought to the signature of procedures in cogit.c. Here we have something like
>>
>> static sqInt abstractRegisterForConcreteRegister(AbstractInstruction * self_in_abstractRegisterForConcreteRegister, sqInt reg) NoDbgRegParms;
>>
>> and the definition is
>>
>> static sqInt
>> abstractRegisterForConcreteRegister(AbstractInstruction * self_in_abstractRegisterForConcreteRegister, sqInt reg)
>> {
>>
>> It seems that the NoDbgRegParms is changing the game. So I assume the signatures have to be exactly the same. Putting NoDbgRegParms after the parentheses in the definition does not work. So I changed both to have it in front like
>>
>> NoDbgRegParms static sqInt abstractRegisterForConcreteRegister(AbstractInstruction * self_in_abstractRegisterForConcreteRegister, sqInt reg);
>>
>> and
>>
>> NoDbgRegParms static sqInt
>> abstractRegisterForConcreteRegister(AbstractInstruction * self_in_abstractRegisterForConcreteRegister, sqInt reg)
>> {
>>
>> and this compiles for me. So two questions:
>>
>> - am I write with my assumption and is the change a valid solution for the problem
>> - if yes will you change it or should I give it a try. It will take some time for me to figure out where that is exactly in the VMMaker code and I assume that it is a no-brainer for someone developing actively with VMMaker
>>
>> regards,
>>
>> Norbert
>

tty
Reply | Threaded
Open this post in threaded view
|

Re: GCC version > 4.4

tty
In reply to this post by NorbertHartl
 
This is the same error I was/am getting. 


bash-4.2$ gcc --version
gcc (GCC) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.
My "fix" did not carry over to debug types other than for buildType build. I will be investigating after I get a pure Linux 32 bit configuration and associated help pushed for CMakeVMakerSqueak.


Below is an email I sent to the board a few weeks ago; perhaps somebody will know what the issue is. 

-----------------begin previous email-------------

In Cog/src/vm/cogit.c in moving the #include "dispdbg.h" above the #include "cointerp.h" and #include "cogit.h" like so:


#include <stddef.h>
#include "sq.h"
#include "sqCogStackAlignment.h"
#include "cogmethod.h"
#include "dispdbg.h"
#if COGMTVM
#include "cointerpmt.h"
#else
#include "cointerp.h"
#endif
#include "cogit.h"
 

appears to solve the problem. 

My initial thinking is a so.

dispdg.h brings in sqAssert.h which defines PRODUCTION as 1 or 0 depending on CFLAGS passed in.

With dispbdg.h included after cogit.h, PRODUCTION  was not defined and the tests in cogit.h


#if !PRODUCTION && defined(__GNUC__) && !defined(NoDbgRegParms)
# define NoDbgRegParms __attribute__ ((regparm (0)))
#endif

#if !defined(NoDbgRegParms)
# define NoDbgRegParms /*empty*/
#endif
 

My conjecture is as follows (I am NOT fluent in the semantics of cpp, just a script kiddy who bit the bullet and rtfm this week (: ).

In the ....../build/vm/Makefile, $(interp)?.o is generated prior to cogit.o.
gcc3x-cointerp.c includes sqAssert.h via dispdg.h prior to the cogit.h and cointerp.h included.
This PRODUCTION is set 0 or 1 and NoDbgRegParms is defined one way or the other.
cpp then pre-processes cogit.h. 
At this point, I lose track of the semantics, but I deduce that NoDbgRegParms IS defined from the gcc3x-cointerp.c parse so NoDbgRegParms is left as is in the cogit.c file.
This was the bug I was tracking down.

I leave it to the more experienced to judge the correctness of the forensics.

cheers.

tty.