Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info

READ-ONLY-MODE: PLEASE DO NOT POST NEW STUFF!
  New Forum: http://forum.puppylinux.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 12 Aug 2020, 09:16
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Compiling
GCC cross-compiling in puppy
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
Page 1 of 1 [4 Posts]  
Author Message
perdido


Joined: 09 Dec 2013
Posts: 1601
Location: ¿Altair IV , Just north of Eeyore Junction.?

PostPosted: Tue 28 Apr 2020, 22:40    Post subject:  GCC cross-compiling in puppy
Subject description: Problems setting up the gcc cross-compiler
 

Compiled new versions of 64-bit gcc 6.20 & 6.55
Am now attempting to set up a cross-compiling environment using a 64-bit xenial or bionic as I would like to compile 32-bit programs using the 64-bit gcc

I have tried using the stock gcc and also my installed compiled versions to compile a cross-compiling gcc 6.2.0 or 6.5.5 in 64-bit xenial or bionic by bootstrapping from the exact same version I was trying to build.
32-bit c headers are installed.

My question is has anyone been able to make a cross-compiling gcc in 64-bit puppy?
I suspect my error may be that i need to compile a whole new toolchain and not just a new gcc and 32-bit c headers.
Back to top
View user's profile Send private message 
enrique

Joined: 09 Nov 2019
Posts: 601
Location: Planet Earth

PostPosted: Wed 29 Apr 2020, 01:20    Post subject: Re: GCC cross-compiling in puppy
Subject description: Problems setting up the gcc cross-compiler
 

Lately I have been misunderstanding issues. So lets start by asking it again. This is what I understood you objective is:
perdido wrote:
... I would like to compile 32-bit programs using the 64-bit gcc....



You do not need a "cross-compiling environment". to compile a 32 bit program inside a 64bit OS.

But if you 32 bit program use external libraries, and you want to execute the code in 64bit OS then you most install 32bit compatibility.

In Ubuntus/Debian deb this is done thru the use of
Code:
dpkg --print-foreign-architectures
sudo dpkg --add-architecture i386


In Puppy I guess is "32bit compatibility" package.

Now going back to just compile. 32bits are build adding -m32 as cflag

Code:
export CFLAGS='-m32'
export CXXFLAGS='-m32'
export LDFLAGS='-m32'
make


or simple gcc command
Code:
gcc -m32 hellow.c -o hellow


I had done compilation version for extra gcc only to get an old gcc for new OS. As new oses had banned old gcc.

Or real cross-compile like ARM etc.
Back to top
View user's profile Send private message 
perdido


Joined: 09 Dec 2013
Posts: 1601
Location: ¿Altair IV , Just north of Eeyore Junction.?

PostPosted: Wed 29 Apr 2020, 17:36    Post subject: Re: GCC cross-compiling in puppy
Subject description: Problems setting up the gcc cross-compiler
 

enrique wrote:
Lately I have been misunderstanding issues. So lets start by asking it again. This is what I understood you objective is:
perdido wrote:
... I would like to compile 32-bit programs using the 64-bit gcc....



You do not need a "cross-compiling environment". to compile a 32 bit program inside a 64bit OS.

But if you 32 bit program use external libraries, and you want to execute the code in 64bit OS then you most install 32bit compatibility.

In Ubuntus/Debian deb this is done thru the use of
Code:
dpkg --print-foreign-architectures
sudo dpkg --add-architecture i386


In Puppy I guess is "32bit compatibility" package.

Now going back to just compile. 32bits are build adding -m32 as cflag

Code:
export CFLAGS='-m32'
export CXXFLAGS='-m32'
export LDFLAGS='-m32'
make


or simple gcc command
Code:
gcc -m32 hellow.c -o hellow


I had done compilation version for extra gcc only to get an old gcc for new OS. As new oses had banned old gcc.

Or real cross-compile like ARM etc.


Thanks for the clear answer. Smile I appreciate the help.

Background:
Mozilla requires all 32-bit binaries to now be compiled in a 64-bit environment . I wish to compile a 32-bit seamonkey-2.53.1, I have compiled a 64-bit seamonkey-2.53.1 using xenial64 with the upgraded gcc 6.2 version.

Seamonkey-2.53.1 requires a gcc 6.1 or newer and glibc 2.6 or older.
Puppy xenial 64 has glibc 2.6 and gcc 5.4
Puppy bionic64 has glibc 2.7 and gcc 7.xx

Neither can be used as built. I thought it would be easier to build gcc 6.2 or gcc 6.5 and add it to xenial to make my build environment for seamonkey. I built seamonkey 2.53.1 64 bit version using xenial64 with upgraded gcc to version 6.2 with success.
When I tried building 32-bit seamonkey 2.53.1 there were m32 errors and the gcc 6.2 would not create 32-bit binaries. That same gcc had just compiled 64-bit seamonkey.
After that happened I thought that I needed a dedicated cross-compile environment and tried building gcc 6.5 as a cross compiler but it always failed to build. I could build it as x64 but not cross-compiling. I was stuck.

Now knowing the 64-bit gcc does all x86 compiling opens the door and I tried a 32-bit seamonkey in xenial64 with upgraded gcc to version 6.5
The gcc 6.5 will create 32-bit binaries and passes that check, the gcc 6.2 failed that check and I did not run the tests after compiling gcc 6.2 so something is broken in the gcc 6.2 for 32-bit compiling.
Now I am trying to compile seamonkey 2.53.1 32-bit in xenial64 with upgraded gcc 6.5
Thank you enrique Smile
Back to top
View user's profile Send private message 
enrique

Joined: 09 Nov 2019
Posts: 601
Location: Planet Earth

PostPosted: Tue 05 May 2020, 08:01    Post subject:  

perdido

Uhhm! My posted information should work on any program You create and build for your self. Where you have control over what is included.

I see you dilemma, you do know how to compile. But you trying to hack over a decision made by the original developer. They decided ONLY 64bit support.

I am not trying to say you will not succeed. I witch you the best. But if a developer made his mind he can easily put in place mechanism to make any 32bit compilation impossible. Can be as simple as not providing a 32 bit required library. That will be to obvious as you will see the missing library output. So instead a developer can not update old 32bit libraries making the creation of a final 32 bit solution buildable but none workable. Or just simply broken.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [4 Posts]  
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Compiling
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0879s ][ Queries: 12 (0.0108s) ][ GZIP on ]