# Compilation error in cont.c

**URL:** <https://www.ruby-forum.com/t/compilation-error-in-cont-c/137069>\
**Category:** Ruby\
**Created:** [May 8, 2008, 6:00pm UTC](https://www.ruby-forum.com/t/compilation-error-in-cont-c/137069 "2008-05-08T18:00:49Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![deliak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/9e8a1a/32.png) [@deliak](https://www.ruby-forum.com/u/deliak)\
**Post date:** [May 8, 2008, 6:00pm UTC](https://www.ruby-forum.com/t/compilation-error-in-cont-c/137069/1 "2008-05-08T18:00:49Z")

</div>

Hi,  
with ruby 1.9.0-1, I get the following error during the  
cross-compilation :

cont.o -c cont.c  
cont.c: In function `cont_restore_0': cont.c:327: error: structure has no member named`machine\_stack\_src’  
make: \*\*\* [cont.o] Error 1

This code seems not to be usually compiled.

Thanks,  
Emanuele.

---

<div class="post-metadata">

**Author:** ![deliak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/9e8a1a/32.png) [@deliak](https://www.ruby-forum.com/u/deliak)\
**Post date:** [May 8, 2008, 6:11pm UTC](https://www.ruby-forum.com/t/compilation-error-in-cont-c/137069/2 "2008-05-08T18:11:04Z")

</div>

Hi,

In message “Re: Compilation error in cont.c”  
on Fri, 9 May 2008 01:00:49 +0900, Emanuele R.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

|Hi,  
|with ruby 1.9.0-1, I get the following error during the  
|cross-compilation :  
|  
|cont.o -c cont.c  
|cont.c: In function `cont_restore_0': |cont.c:327: error: structure has no member named `machine\_stack\_src’  
|make: \*\*\* [cont.o] Error 1  
|  
|This code seems not to be usually compiled.

Could you try the trunk from the svn repo?

We also need you platform information. 1.9.0-1 was compiled without  
any problem on my Linux box.

```
          matz.

```

---

<div class="post-metadata">

**Author:** ![deliak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/9e8a1a/32.png) [@deliak](https://www.ruby-forum.com/u/deliak)\
**Post date:** [May 8, 2008, 7:07pm UTC](https://www.ruby-forum.com/t/compilation-error-in-cont-c/137069/3 "2008-05-08T19:07:30Z")

</div>

Yukihiro M. wrote:

> Hi,
> 
> In message “Re: Compilation error in cont.c”  
> on Fri, 9 May 2008 01:00:49 +0900, Emanuele R.  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:
> 
> |Hi,  
> |with ruby 1.9.0-1, I get the following error during the  
> |cross-compilation :  
> |  
> |cont.o -c cont.c  
> |cont.c: In function `cont_restore_0': |cont.c:327: error: structure has no member named `machine\_stack\_src’  
> |make: \*\*\* [cont.o] Error 1  
> |  
> |This code seems not to be usually compiled.
> 
> Could you try the trunk from the svn repo?
> 
> We also need you platform information. 1.9.0-1 was compiled without  
> any problem on my Linux box.
> 
> ```
> matz.
> 
> ```

Thank you very much for answering Matsumoto-sensei,

I just tried to cross compile ruby 1.9 trunk getting the same error:

arm-linux-gcc -mbig-endian -I. -I.ext/include/arm-linux -I./include  
-I. -DRUBY\_EXPORT -D\_GNU\_SOURCE=1 -o cont.o -c cont.c  
cont.c: In function `cont_restore_0': cont.c:326: error: structure has no member named `machine\_stack\_size’  
make: \*\*\* [cont.o] Error 1

I’m cross compiling ruby for an arm processor embedded device on an  
ubuntu gutsy gibbon vm using the embedded device compiler tool chain.

So from the configure log:  
checking build system type… i686-pc-linux-gnu  
checking host system type… arm-unknown-linux-gnu  
checking target system type… arm-unknown-linux-gnu  
checking for arm-linux-gcc… arm-linux-gcc  
checking for arm-linux-gcc… (cached) arm-linux-gcc

I configured it with exactly the same options I used to succesfully  
cross compile ruby 1.8.6 p114:  
./configure --host=arm-linux CFLAGS=-mbig-endian LDFLAGS=-mbig-endian

Please tell me if any other info could be useful.

Thanks,  
Emanuele.

---

<div class="post-metadata">

**Author:** ![deliak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/9e8a1a/32.png) [@deliak](https://www.ruby-forum.com/u/deliak)\
**Post date:** [May 9, 2008, 12:50am UTC](https://www.ruby-forum.com/t/compilation-error-in-cont-c/137069/4 "2008-05-09T00:50:01Z")

</div>

Hi,

In message “Re: Compilation error in cont.c”  
on Fri, 9 May 2008 02:07:30 +0900, Emanuele R.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

|I just tried to cross compile ruby 1.9 trunk getting the same error:

I just checked in the possible fix. Could you try the latest again?

```
          matz.

```

---

<div class="post-metadata">

**Author:** ![deliak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/9e8a1a/32.png) [@deliak](https://www.ruby-forum.com/u/deliak)\
**Post date:** [May 9, 2008, 11:25am UTC](https://www.ruby-forum.com/t/compilation-error-in-cont-c/137069/5 "2008-05-09T11:25:35Z")

</div>

Yukihiro M. wrote:  
Could you try the latest again?

Thank you really very much for patching the trunk, indeed now I’m able  
to cross compile succesfully ruby 1.9.

However once I put it on the target and launch it I get the following  
error:

ruby1.9: /lib/librt.so.1: no version information available (required by  
ruby1.9)  
Segmentation fault

Could you give me an hint also about that?

Thank you again,  
Emanuele.

---

<div class="post-metadata">

**Author:** ![deliak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/9e8a1a/32.png) [@deliak](https://www.ruby-forum.com/u/deliak)\
**Post date:** [May 9, 2008, 4:32pm UTC](https://www.ruby-forum.com/t/compilation-error-in-cont-c/137069/6 "2008-05-09T16:32:42Z")

</div>

Yukihiro M. wrote:

> That seems to be a linker problem around librt. You have to check  
> whether librt installed correctly. Or you can remove -lrt from  
> configure. I have virtually zero knowledge about cross compiling, but  
> it should be possible.

Hi,  
removing -lrt I get the following error:  
./libruby-static.a(time.o)(.text+0x198): In function `time_init': : undefined reference to `clock\_gettime’  
collect2: ld returned 1 exit status  
make[1]: \*\*\* [ruby] Error 1  
make[1]: Leaving directory `/home/del/Desktop/rubytrunk/ruby’  
make: \*\*\* [all] Error 2

The “no version information available” kind of error seems to be the  
result of a library mismatch between the build and target systems  
([Google Answers: Meaning of message "no version information available" at run-time on Linux](http://answers.google.com/answers/threadview?id=786136)).

I’ll tell you as soon as I get it to work.

Emanuele.

---

<div class="post-metadata">

**Author:** ![deliak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/9e8a1a/32.png) [@deliak](https://www.ruby-forum.com/u/deliak)\
**Post date:** [May 10, 2008, 12:52am UTC](https://www.ruby-forum.com/t/compilation-error-in-cont-c/137069/7 "2008-05-10T00:52:31Z")

</div>

Hi,

In message “Re: Compilation error in cont.c”  
on Fri, 9 May 2008 23:32:42 +0900, Emanuele R.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:  
|  
|Yukihiro M. wrote:  
|\> That seems to be a linker problem around librt. You have to check  
|\> whether librt installed correctly. Or you can remove -lrt from  
|\> configure. I have virtually zero knowledge about cross compiling, but  
|\> it should be possible.  
|  
|Hi,  
|removing -lrt I get the following error:  
|./libruby-static.a(time.o)(.text+0x198): In function `time_init': |: undefined reference to `clock\_gettime’  
|collect2: ld returned 1 exit status  
|make[1]: \*\*\* [ruby] Error 1  
|make[1]: Leaving directory `/home/del/Desktop/rubytrunk/ruby’  
|make: \*\*\* [all] Error 2

By “removing -lrt”, I also meant removing HAVE\_CLOCK\_GETTIME from  
\<config.h\>.

|The “no version information available” kind of error seems to be the  
|result of a library mismatch between the build and target systems  
|([Google Answers: Meaning of message "no version information available" at run-time on Linux](http://answers.google.com/answers/threadview?id=786136)).  
|  
|I’ll tell you as soon as I get it to work.

I hope you can solve the version inconsistency.

```
          matz.

```

---

<div class="post-metadata">

**Author:** ![deliak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/9e8a1a/32.png) [@deliak](https://www.ruby-forum.com/u/deliak)\
**Post date:** [May 9, 2008, 12:03pm UTC](https://www.ruby-forum.com/t/compilation-error-in-cont-c/137069/8 "2008-05-09T12:03:51Z")

</div>

Hi,

In message “Re: Compilation error in cont.c”  
on Fri, 9 May 2008 18:25:36 +0900, Emanuele R.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

|Thank you really very much for patching the trunk, indeed now I’m able  
|to cross compile succesfully ruby 1.9.

Sounds nice.

|However once I put it on the target and launch it I get the following  
|error:  
|  
|ruby1.9: /lib/librt.so.1: no version information available (required by  
|ruby1.9)  
|Segmentation fault  
|  
|Could you give me an hint also about that?

That seems to be a linker problem around librt. You have to check  
whether librt installed correctly. Or you can remove -lrt from  
configure. I have virtually zero knowledge about cross compiling, but  
it should be possible.

```
          matz.

```

---

<div class="post-metadata">

**Author:** ![deliak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/9e8a1a/32.png) [@deliak](https://www.ruby-forum.com/u/deliak)\
**Post date:** [May 12, 2008, 11:42am UTC](https://www.ruby-forum.com/t/compilation-error-in-cont-c/137069/9 "2008-05-12T11:42:04Z")

</div>

Yukihiro M. wrote:

> By “removing -lrt”, I also meant removing HAVE\_CLOCK\_GETTIME from  
> \<config.h\>.

Hi,  
I should have read time.c. Indeed removing HAVE\_CLOCK\_GETTIME I’m able  
to get to the end of the compilation process.  
I still get the “Segmentation error” trying the resulting ruby on the  
target, doe.  
I guess I must recompile the glibc libraries to match those of the  
building system…

> I hope you can solve the version inconsistency.

Me too, trying to cross-compile the glibc libraries right now.

Thank you again,  
Emanuele.
