1. compiling translated files on Linux AMD64

Hi,

Does anyone know how to compile translated files on Linux AMD64?

Specifically my problem is a failure of translated euphoria code
to compile under: 

gcc version 4.2.1 (SUSE Linux 10.3)

ken@linux-40ht:~> gcc --ver
Using built-in specs.
Target: x86_64-suse-linux
Configured with: 
../configure --enable-threads=posix --prefix=/usr 
--with-local-prefix=/usr/local --infodir=/usr/share/info 
--mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada 
--enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.2.1 
--enable-ssp --disable-libssp --disable-libgcj --with-slibdir=/lib64 
--with-system-zlib --enable-shared --enable-__cxa_atexit 
--enable-libstdcxx-allocator=new --disable-libstdcxx-pch 
--program-suffix=-4.2 --enable-version-specific-runtime-libs 
--without-system-libunwind --with-cpu=generic --host=x86_64-suse-linux
Thread model: posix


Ken Rhodes
Folding at Home: http://folding.stanford.edu/
100% MicroSoft Free
SuSE Linux 10.0
No AdWare, SpyWare, or Viruses!
Life is Good,  smile

new topic     » topic index » view message » categorize

2. Re: compiling translated files on Linux AMD64

Kenneth Rhodes wrote:
> 
> Hi,
> 
> Does anyone know how to compile translated files on Linux AMD64?
> 
> Specifically my problem is a failure of translated euphoria code
> to compile under: 
> 
> gcc version 4.2.1 (SUSE Linux 10.3)
> 

What is the compile error?

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view message » categorize

3. Re: compiling translated files on Linux AMD64

Jeremy Cowgar wrote:
> 
> Kenneth Rhodes wrote:
> > 
> > Hi,
> > 
> > Does anyone know how to compile translated files on Linux AMD64?
> > 
> > Specifically my problem is a failure of translated euphoria code
> > to compile under: 
> > 
> > gcc version 4.2.1 (SUSE Linux 10.3)
> > 
> 
> What is the compile error?
> 
> --
> Jeremy Cowgar
> <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a>

/usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../x86_64-suse-linux/bin/ld:
i386 architecture of input file `/home/ken/euphoria/bin/ecu.a(be_machine.o)' 
is incompatible with i386:x86-64 output




Ken Rhodes
Folding at Home: http://folding.stanford.edu/
100% MicroSoft Free
SuSE Linux 10.0
No AdWare, SpyWare, or Viruses!
Life is Good,  smile

new topic     » goto parent     » topic index » view message » categorize

4. Re: compiling translated files on Linux AMD64

Kenneth Rhodes wrote:
> 
> /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../x86_64-suse-linux/bin/ld:
> i386 architecture of input file `/home/ken/euphoria/bin/ecu.a(be_machine.o)'
> 
> is incompatible with i386:x86-64 output
> 

You're going to have to compile Euphoria on the x86 then getlost That's the only
solution. Luckly, it's not hard on Linux. You should be able to change to the
source directory and type make. That will build new binaries and a new ecu.a.
Save your previous ecu.a and then copy the new ecu.a to the ../bin dir of
euphoria and give it another go and see what happens.

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view message » categorize

5. Re: compiling translated files on Linux AMD64

Jeremy Cowgar wrote:
> 
> Kenneth Rhodes wrote:
> > 
> > /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../x86_64-suse-linux/bin/ld:
> > i386 architecture of input file `/home/ken/euphoria/bin/ecu.a(be_machine.o)'
> > 
> > is incompatible with i386:x86-64 output
> > 
> 
> You're going to have to compile Euphoria on the x86 then getlost That's the only
> solution. Luckly, it's not hard on Linux. You should be able to change to the
> source directory and type make. That will build new binaries and a new ecu.a.
> Save your previous ecu.a and then copy the new ecu.a to the ../bin dir of
> euphoria
> and give it another go and see what happens.
> 
> --
> Jeremy Cowgar
> <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a>

No joy... it appears that a bit of editing needs to be done to the 
source files before compiling under Linux, and 32bit Linux at that:
from the readme file in the source directory:

-----------------------------------------------------------------------
                        Euphoria for Linux, exu
GNU C
=====
  You'll have to convert the line terminators in the
  source files to the Linux standard of \n, rather than
  the Windows/DOS form of \r\n, otherwise several files
  will give you errors. You can use:

       exu fixline.ex

  for this. Also, when you save a file using ed.ex, it will let you
  convert to \n terminators. You should also ensure that all
  source file names are lower case (unzip -L).

  build exu with: imakeu
  Make sure it has \n line-terminators, and execute permission
  (chmod +x imakeu).

  exu will run at full speed. -DINT_CODES is not used.

  The interactive trace, trace(1) should fully work.

-----------------------------------------------------------------------

I'll do all the above and try again.

But I'm a bit confused .....  I was thinking that there might be a
switch for gcc to allow it to emit 32bit code. Or a GNU cross compiler
or something. 

Ken Rhodes
Folding at Home: http://folding.stanford.edu/
100% MicroSoft Free
SuSE Linux 10.0
No AdWare, SpyWare, or Viruses!
Life is Good,  smile

new topic     » goto parent     » topic index » view message » categorize

6. Re: compiling translated files on Linux AMD64

Kenneth Rhodes wrote:
> 
> 
> I'll do all the above and try again.
> 
> But I'm a bit confused .....  I was thinking that there might be a
> switch for gcc to allow it to emit 32bit code. Or a GNU cross compiler
> or something. 
>

It would be nice to be able to make a 64bit app. I am not sure of the
ramifications. I did find this for you:

http://www.cyberciti.biz/tips/compile-32bit-application-using-gcc-64-bit-linux.html

Maybe that will help for the interim?

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view message » categorize

7. Re: compiling translated files on Linux AMD64

Jeremy Cowgar wrote:

> It would be nice to be able to make a 64bit app. I am not sure of the
> ramifications.
> I did find this for you:
> 
> <a
> href="http://www.cyberciti.biz/tips/compile-32bit-application-using-gcc-64-bit-linux.html">http://www.cyberciti.biz/tips/compile-32bit-application-using-gcc-64-bit-linux.html</a>
> 
> Maybe that will help for the interim?
> 
> --
> Jeremy Cowgar

Thanks Jeremy.  I'll play around with it all a bit and see what I
can come up with.


Ken Rhodes
Folding at Home: http://folding.stanford.edu/
100% MicroSoft Free
SuSE Linux 10.3
No AdWare, SpyWare, or Viruses!
Life is Good,  smile

new topic     » goto parent     » topic index » view message » categorize

8. Re: compiling translated files on Linux AMD64

Hi

I've never been able to compile under 64 bit Linux either. There's a fundamental
incompatability in the C emitted and used, that the version of gcc doesn't
like (can't remember what it is right now, though I have posted about it here
before). This includes translated programs. I've tried various switches, with no
success.

It works fine on my 32 bit system, but I don't bother any more, because
the translated and compiled program was 5 times the size of the bound program.
Just no need.

Chris

new topic     » goto parent     » topic index » view message » categorize

9. Re: compiling translated files on Linux AMD64

ChrisBurch3 wrote:
> 
> It works fine on my 32 bit system, but I don't bother any more, because
> the translated and compiled program was 5 times the size of the bound program.
> Just no need.
> 

Really???

-rwxr-xr-x 1 jeremy jeremy 242K 2008-05-16 16:36 hello.bound
-rw-r--r-- 1 jeremy jeremy   25 2008-05-16 16:32 hello.e
-rwxr-xr-x 1 jeremy jeremy 134K 2008-05-16 16:32 hello.translated

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view message » categorize

10. Re: compiling translated files on Linux AMD64

Yup, really, try it with a large program, like jetvet.

Chris

new topic     » goto parent     » topic index » view message » categorize

11. Re: compiling translated files on Linux AMD64

ChrisBurch3 wrote:
> 
> Hi
> 
> I've never been able to compile under 64 bit Linux either. There's a
> fundamental
> incompatability in the C emitted and used, that the version of gcc doesn't
> like (can't remember what it is right now, though I have posted about it here
> before). This includes translated programs. I've tried various switches, with
> no success.


I haven't had any success with translated code using the switches 
taken from the page Jeremy referenced in a previous post.

If the source code in the euphoria Linux package is "broken" for AMD64,
then the documentation should reflect that-- especially the blurbs on
the download page.  Likewise, Euphoria to C translation for AMD64 is broken
and this should be noted in the documentation and relevant web pages. 

Is the only fix for this going to be a true port of Euphoria to AMD64?


> 
> It works fine on my 32 bit system, but I don't bother any more, because
> the translated and compiled program was 5 times the size of the bound program.
> Just no need.
> 

Did you use UPX?




Ken Rhodes
Folding at Home: http://folding.stanford.edu/
100% MicroSoft Free
SuSE Linux 10.3
No AdWare, SpyWare, or Viruses!
Life is Good,  smile

new topic     » goto parent     » topic index » view message » categorize

12. Re: compiling translated files on Linux AMD64

Kenneth Rhodes wrote:
>  
> I haven't had any success with translated code using the switches 
> taken from the page Jeremy referenced in a previous post.
>

Bummer. Sorry.
 
> If the source code in the euphoria Linux package is "broken" for AMD64,
> then the documentation should reflect that-- especially the blurbs on
> the download page.  Likewise, Euphoria to C translation for AMD64 is broken
> and this should be noted in the documentation and relevant web pages. 

Yes. It should. I have an AMD64 box here, but it currently only has Windows
Vista on it (it's my wifes computer). I will find a HD laying around and put
Linux on it and see what I can figure out, but that probably will not be until
this weekend. I hope that's OK.
 
> Is the only fix for this going to be a true port of Euphoria to AMD64?

I'll have more info this weekend.

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view message » categorize

13. Re: compiling translated files on Linux AMD64

Jeremy Cowgar wrote:

> Yes. It should. I have an AMD64 box here, but it currently only has Windows
> Vista on it (it's my wifes computer). I will find a HD laying around and put
> Linux on it and see what I can figure out, but that probably will not be until
> this weekend. I hope that's OK.
>  
> > Is the only fix for this going to be a true port of Euphoria to AMD64?
> 
> I'll have more info this weekend.

Rots a ruck.  Maybe with two hard drives there is someway to dual boot,
but I was told by the salesman at Best Buy that Vista would not allow
dual booting.

Does Euphoria compile with no problems on AMD64 under Windows?

Ken Rhodes
Folding at Home: http://folding.stanford.edu/
100% MicroSoft Free
SuSE Linux 10.3
No AdWare, SpyWare, or Viruses!
Life is Good,  smile

new topic     » goto parent     » topic index » view message » categorize

14. Re: compiling translated files on Linux AMD64

Kenneth Rhodes wrote:
> 
> Rots a ruck.  Maybe with two hard drives there is someway to dual boot,
> but I was told by the salesman at Best Buy that Vista would not allow
> dual booting.
>

He doesn't know what he's talking about. I dual boot vista all the time on my
box. Same HD.
 
> Does Euphoria compile with no problems on AMD64 under Windows?

Never tried. I try to let my wife's PC be hers, otherwise, I have a tendency to
slowly overtake it and always *need* it when she wants to use it getlost

I can add that to the list smile

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view message » categorize

15. Re: compiling translated files on Linux AMD64

Jeremy Cowgar wrote:
> 
> Kenneth Rhodes wrote:
> > 
> > Rots a ruck.  Maybe with two hard drives there is someway to dual boot,
> > but I was told by the salesman at Best Buy that Vista would not allow
> > dual booting.
> >
> 
> He doesn't know what he's talking about. I dual boot vista all the time on my
> box. Same HD.
>  

Hmmmmm, sounds like a bit more MS propaganda to fend off Linux.

So which version of Linux are you using?  I've been thinking about
migrating to Ubuntu/Kubuntu.



Ken Rhodes
Folding at Home: http://folding.stanford.edu/
100% MicroSoft Free
SuSE Linux 10.3
No AdWare, SpyWare, or Viruses!
Life is Good,  smile

new topic     » goto parent     » topic index » view message » categorize

16. Re: compiling translated files on Linux AMD64

Success!

In order to use the -m32 switch, the 32bit version of gcc must be
installed in addition to the native gcc 64 bit compiler.

./ecu ed.ex -- generated the *.c files and emake
edit the emake file to include the -m32 switch:

echo compiling with GNU C
echo main-.c
gcc -m32 -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer main-.c
echo ed.c
gcc -m32 -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer ed.c
echo ed_0.c
gcc -m32 -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer ed_0.c
echo ed_1.c
gcc -m32 -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer ed_1.c
echo graphics.c
gcc -m32 -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer graphics.c
echo get.c
gcc -m32 -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer get.c
echo file.c
gcc -m32 -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer file.c
echo wildcard.c
gcc -m32 -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer wildcard.c
echo dll.c
gcc -m32 -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer dll.c
echo syncolor.c
gcc -m32 -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer syncolor.c
echo init-.c
gcc -m32 -c -w -fsigned-char -O2 -ffast-math -fomit-frame-pointer init-.c
echo linking
gcc  -m32 ed.o main-.o ed_0.o ed_1.o graphics.o get.o file.o wildcard.o dll.o
syncolor.o init-.o  /home/ken/euphoria/bin/ecu.a -lm  -ldl -oed
rm -f *.o
echo you can now execute: ./ed
rm main-.c
rm main-.h
rm init-.c
rm ed.c
rm ed_0.c
rm ed_1.c
rm graphics.c
rm get.c

Everything is sooooooooo simple-- in retrospect.

I'm not sure what would happen if the -m32 switch was 
added to the emake generation code. If under a 32bit system
the switch is just ignored, then we've got a genuine kludge, eh?

Ken Rhodes
Folding at Home: http://folding.stanford.edu/
100% MicroSoft Free
SuSE Linux 10.3
No AdWare, SpyWare, or Viruses!
Life is Good,  smile

new topic     » goto parent     » topic index » view message » categorize

17. Re: compiling translated files on Linux AMD64

Kenneth Rhodes wrote:
> 
> Success!
> 

Great job! This is very good news. Thank you for working on this so long. I am
going to ask one thing, if you would... Can you add your instructions to the wiki
so that they do not get lost?

http://euwiki.ayo.biz/Main_Page

That wiki will soon be moving to openeuphoria.org smile

> In order to use the -m32 switch, the 32bit version of gcc must be
> installed in addition to the native gcc 64 bit compiler.
> 
> ./ecu ed.ex -- generated the *.c files and emake
> edit the emake file to include the -m32 switch:
> 

<snip>

> 
> Everything is sooooooooo simple-- in retrospect.
>

hehe. Everything (well, almost) always does.
 
> I'm not sure what would happen if the -m32 switch was 
> added to the emake generation code. If under a 32bit system
> the switch is just ignored, then we've got a genuine kludge, eh?
> 

I wonder if we should add a parameter to ecu/ecw that will pass parameters on to
the compiler/linker:

./ecu -cparams "-m32 -abc -def" -ldparams "-??? -???" myprog.ex

Or something like that?

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view message » categorize

18. Re: compiling translated files on Linux AMD64

Jeremy Cowgar wrote:
> 
> Kenneth Rhodes wrote:
>  
> > I'm not sure what would happen if the -m32 switch was 
> > added to the emake generation code. If under a 32bit system
> > the switch is just ignored, then we've got a genuine kludge, eh?
> > 
> 
> I wonder if we should add a parameter to ecu/ecw that will pass parameters on
> to the compiler/linker:
> 
> ./ecu -cparams "-m32 -abc -def" -ldparams "-??? -???" myprog.ex
> 
> Or something like that?

That would be useful.  It might also make sense to add a specific switch
for 64-bit platforms, since these are likely to become more common.  I'd
think something like:

  -64

Or maybe there's a way to detect this by default and make it happen 
automagically?  I think it should be available through uname, which we 
are already using in configure in the build process.

I suppose we could also see if this causes problems on a 32-bit system, and 
if not, just add it by default.  This seems like it would work, but is
just not very elegant.

Matt

new topic     » goto parent     » topic index » view message » categorize

19. Re: compiling translated files on Linux AMD64

Matt Lewis wrote:
> 
> Or maybe there's a way to detect this by default and make it happen 
> automagically?  I think it should be available through uname, which we 
> are already using in configure in the build process.
> 

Do we have these problems on Windows when using say 64bit Vista?

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view message » categorize

20. Re: compiling translated files on Linux AMD64

Jeremy Cowgar wrote:
> 
> Matt Lewis wrote:
> > 
> > Or maybe there's a way to detect this by default and make it happen 
> > automagically?  I think it should be available through uname, which we 
> > are already using in configure in the build process.
> > 
> 
> Do we have these problems on Windows when using say 64bit Vista?

This is really a compiler issue.  I don't believe that OpenWatcom supports
64-bit targets, so there should be no problem.  Off the top of my head, I'd
guess that BCC doesn't either, and that LCC might.

Matt

new topic     » goto parent     » topic index » view message » categorize

21. Re: compiling translated files on Linux AMD64

Jeremy Cowgar wrote:
> 
> Kenneth Rhodes wrote:
> > 
> > Success!
> > 
> 
> Great job! This is very good news. Thank you for working on this so long. I
> am going to ask one thing, if you would... Can you add your instructions to
> the wiki so that they do not get lost?
> 
> <a href="http://euwiki.ayo.biz/Main_Page">http://euwiki.ayo.biz/Main_Page</a>
> 

Ok... I'll do that.

new topic     » goto parent     » topic index » view message » categorize

22. Re: compiling translated files on Linux AMD64

Kenneth Rhodes wrote:
> 
> Jeremy Cowgar wrote:
> > 
> > Kenneth Rhodes wrote:
> > > 
> > > Success!
> > > 
> > 
> > Great job! This is very good news. Thank you for working on this so long. I
> > am going to ask one thing, if you would... Can you add your instructions to
> > the wiki so that they do not get lost?
> > 
> > <a
> > href="http://euwiki.ayo.biz/Main_Page">http://euwiki.ayo.biz/Main_Page</a>
> > 
> 
> Ok... I'll do that.

Well, I mucked up my first bout at editing a wiki page. I think I was able
to clean up my mess. I'll keep working on it....



Ken Rhodes
Folding at Home: http://folding.stanford.edu/
100% MicroSoft Free
SuSE Linux 10.3
No AdWare, SpyWare, or Viruses!
Life is Good,  smile

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu