English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 11 February 2018, 00:27   #101
Marlon_
AmigaDev.com
 
Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
You know you can help fix this if only you learn how to github?
Marlon_ is offline  
Old 11 February 2018, 01:12   #102
grelbfarlk
Registered User
 
Join Date: Dec 2015
Location: USA
Posts: 2,902
I sort of know how to github. But I don't really have any idea about setting up an Amidevcpp cross compiler, I mean I have it installed.
grelbfarlk is offline  
Old 11 February 2018, 01:52   #103
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by grelbfarlk View Post
Go Emufan, go! Eye of the tiger! Stiff as a board, light as a feather! Claim your bounty!
woah, bribery
Quote:
Originally Posted by Marlon_ View Post
You know you can help fix this if only you learn how to github?
*sigh*
Quote:
Originally Posted by grelbfarlk View Post
I sort of know how to github. But I don't really have any idea about setting up an Amidevcpp cross compiler, I mean I have it installed.
thats more or less easy:

open a dos prompt (cmd.exe)
cd to the .../AmiDevCpp/bin/ folder
start bash.exe
now you export your PATH:
export PATH=/cygdrive/d/AmiDevCpp/usr/local/amiga/bin:/cygdrive/d/AmiDevCpp/bin:$PATH
thats for D:\AmiDevCpp\usr\local\amiga\bin and D:\AmiDevCpp\bin
now you can start ppc-amigaos-gcc.exe

look in /cygdrive/d/AmiDevCpp/usr/local/amiga/bin for the other cross-compilers

you may add the export line to ~/.bashrc ( /home/$USER/.bashrc )

Last edited by emufan; 11 February 2018 at 02:04.
emufan is offline  
Old 11 February 2018, 06:26   #104
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by emufan View Post
ok, cool. symlink is fine, but after "wasting" hours of build time,
I prefer I more solid solution
i made the symlinks in /gg/ppc-morphos/bin and started a new run, went good, build alot, but then this:
Code:
make[5]: Entering directory '/tmp/tmp.ttt/gcc4/gcc-4.4.5/build/ppc-morphos/libb32/libgcc'
# If this is the top-level multilib, build all the other
# multilibs.
/tmp/tmp.ttt/gcc4/gcc-4.4.5/build/./gcc/xgcc -B/tmp/tmp.ttt/gcc4/gcc-4.4.5/build/./gcc/
-B/gg/ppc-morphos/bin/ -B/gg/ppc-morphos/lib/ -isystem /gg/ppc-morphos/include
-isystem /gg/ppc-morphos/sys-include -g -O2 -mbaserel32 -mstrict-align -O2  -g -O2
-DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings -Wstrict-prototypes
-Wmissing-prototypes -Wcast-qual -Wold-style-definition  -isystem ./include   
-g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I../../.././gcc
-I../../../../libgcc -I../../../../libgcc/. -I../../../../libgcc/../gcc
-I../../../../libgcc/../include  
-DHAVE_CC_TLS -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep 
-DL_muldi3 -c ../../../../libgcc/../gcc/libgcc2.c \
  
In file included from ../../../../libgcc/../gcc/libgcc2.c:29:
../../../../libgcc/../gcc/tsystem.h:87:19: error: stdio.h: No such file or directory
../../../../libgcc/../gcc/tsystem.h:90:23: error: sys/types.h: No such file or directory
../../../../libgcc/../gcc/tsystem.h:93:19: error: errno.h: No such file or directory
../../../../libgcc/../gcc/tsystem.h:100:20: error: string.h: No such file or directory
../../../../libgcc/../gcc/tsystem.h:101:20: error: stdlib.h: No such file or directory
../../../../libgcc/../gcc/tsystem.h:102:20: error: unistd.h: No such file or directory
../../../../libgcc/../gcc/tsystem.h:108:18: error: time.h: No such file or directory
make[5]: *** [Makefile:359: _muldi3.o] Error 1
make[5]: Leaving directory '/tmp/tmp.ttt/gcc4/gcc-4.4.5/build/ppc-morphos/libb32/libgcc'
make[4]: *** [Makefile:975: multi-do] Error 1
make[4]: Leaving directory '/tmp/tmp.ttt/gcc4/gcc-4.4.5/build/ppc-morphos/libgcc'
make[3]: *** [Makefile:109: all-multi] Error 2
make[3]: Leaving directory '/tmp/tmp.ttt/gcc4/gcc-4.4.5/build/ppc-morphos/libgcc'
make[2]: *** [Makefile:11223: all-target-libgcc] Error 2
make[2]: Leaving directory '/tmp/tmp.ttt/gcc4/gcc-4.4.5/build'
make[1]: *** [Makefile:745: all] Error 2
make[1]: Leaving directory '/tmp/tmp.ttt/gcc4/gcc-4.4.5/build'
make: *** [Makefile:121: gcc4_make] Error 2
for whatever reason, and I cannot find the trigger, after that error, all the build folders are gone.
it made a $TMPDIR folder in /tmp but this is gone :/

#1) this one: trap "rm -rf \"$TMPDIR\"" exit ?????
if so, please remove this

Last edited by emufan; 11 February 2018 at 06:51.
emufan is offline  
Old 11 February 2018, 13:28   #105
Marlon_
AmigaDev.com
 
Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
Quote:
Originally Posted by emufan View Post
#1) this one: trap "rm -rf \"$TMPDIR\"" exit ?????
if so, please remove this
Oh, yeah, that one. You could just comment this out yourself. ^^
Marlon_ is offline  
Old 11 February 2018, 14:29   #106
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by Marlon_ View Post
Oh, yeah, that one. You could just comment this out yourself. ^^
I did so, but maybe others run in the same trouble,
so you may remove it on github too

do you have any idea, why the libgcc part cannot find those standard includes?
emufan is offline  
Old 11 February 2018, 14:39   #107
Marlon_
AmigaDev.com
 
Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
Quote:
Originally Posted by emufan View Post
I did so, but maybe others run in the same trouble,
so you may remove it on github too

do you have any idea, why the libgcc part cannot find those standard includes?
Unsure, I personally did not run into this problem.

How is the symlink set up?
Marlon_ is offline  
Old 11 February 2018, 16:43   #108
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
I dont think it's related to the symlink. I made it this way:
Code:
mkdir -p /gg/ppc-morphos/bin
cd /gg/ppc-morphos/bin
ln -s /opt/ppc-warpos/bin/* .
one thing which should help, to continue if something is broken,
is replacing the $TMPDIR (mktemp -d) with something static,
so another start of the toolchain script would use the same folder
and does skip already built things. hopefully. toolchain-morphos:
Code:
	#TMPDIR="`mktemp -d`"
	TMPDIR="`mkdir /tmp/build-ppc`"
fi
CURDIR="`pwd`"

#if [ -z "$TMPDIR" ]
#then
#	echo "Unable to create temporary directory."
#	exit 1
#fi

# trap "rm -rf \"$TMPDIR\"" exit
#1) i found the issue with the mising includes. next to the bin/* folder
it needs the include/* aswell:
Code:
mkdir -p /gg/ppc-morphos/include/
cd /gg/ppc-morphos/include/
ln -s /opt/ppc-warpos/include/* .
this way `make` does work successfully in the libgcc folder.

so it's a problem related to the "--prefix" vs. /gg/ppc-morphos/ path

#2) maybe this does the trick even better:
Code:
mkdir -p /gg/ppc-morphos/
cd /gg/ppc-morphos/
ln -s /opt/ppc-warpos/ppc-morphos/* .

$ ls -l
bin -> /opt/ppc-warpos/ppc-morphos/bin
include -> /opt/ppc-warpos/ppc-morphos/include
lib -> /opt/ppc-warpos/ppc-morphos/lib
sys-include -> /opt/ppc-warpos/ppc-morphos/sys-include

cd .../morphos-cross-toolchain/
./toolchain-morphos -f --gcc gcc4 --prefix /opt/ppc-warpos
next one maybe the best solution, since the files and subfolders
do not yet exists on a fresh install.
Code:
mkdir -p /gg/
mkdir -p /opt/ppc-warpos/ppc-morphos/
cd /gg/
ln -s /opt/ppc-warpos/ppc-morphos .

cd .../morphos-cross-toolchain/
./toolchain-morphos --gcc gcc4 --prefix /opt/ppc-warpos
it does now find include/* and sys-include/* stuff,
both needed when building libgcc.

#3) libgcc build successfully now, and I start `make`in /tmp/tmp.tttt/gcc4/gcc-4.4.5/build/
it does skip already build things, so we'll see how far we can go this time

Last edited by emufan; 11 February 2018 at 17:53.
emufan is offline  
Old 11 February 2018, 22:29   #109
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
some more errors:

#1)
Code:
/tmp/tmp.ttt/gcc4/gcc-4.4.5/build/./gcc/xgcc -B/tmp/tmp.ttt/gcc4/gcc-4.4.5/build/./gcc/
-B/gg/ppc-morphos/bin/ -B/gg/ppc-morphos/lib/ -isystem /gg/ppc-morphos/include
-isystem /gg/ppc-morphos/sys-include -c -DHAVE_CONFIG_H -g -O2    -I.
-I../../../libiberty/../include  -W -Wall -Wwrite-strings -Wc++-compat
-Wstrict-prototypes -pedantic  ../../../libiberty/fopen_unlocked.c -o fopen_unlocked.o
../../../libiberty/fopen_unlocked.c:73:23: error: stdio_ext.h: No such file or directory
make[3]: *** [Makefile:675: fopen_unlocked.o] Error 1
configure found it (logfile says so), but when including, it's not available.
there is one in cygwin/usr/include, but not in the cross-toolchain.
the one from cygwin does not work, gives alot errors.

so I disabled the include from /tmp/tmp.ttt/gcc4/gcc-4.4.5/libiberty/fopen_unlocked.c
and it does build the objectfiles.

#2)
Code:
/tmp/tmp.ttt/gcc4/gcc-4.4.5/build/./gcc/xgcc -B/tmp/tmp.ttt/gcc4/gcc-4.4.5/build/./gcc/
-B/gg/ppc-morphos/bin/ -B/gg/ppc-morphos/lib/ -isystem /gg/ppc-morphos/include
-isystem /gg/ppc-morphos/sys-include -c -DHAVE_CONFIG_H -g -O2    
-mclib=libnix -mstrict-align  -I. -I../../../../libiberty/../include  -W -Wall 
-Wwrite-strings -Wc++-compat -Wstrict-prototypes 
-pedantic  ../../../../libiberty/strsignal.c -o strsignal.o
../../../../libiberty/strsignal.c:554: error: conflicting types for ‘psignal’
/gg/ppc-morphos/include/signal.h:131: note: previous declaration of ‘psignal’ was here
make[2]: *** [Makefile:1057: strsignal.o] Error 1
*not cool*

libiberty/strsignal.c: line 551:
Code:
#ifndef HAVE_PSIGNAL
void
psignal (int signo, char *message)
{
vs: /gg/ppc-morphos/include/signal.h
Code:
#ifndef _POSIX_SOURCE
...
void    psignal __P((unsigned int, const char *));
missing -D_POSIX_SOURCE or -DHAVE_PSIGNAL to prevent that error :/

#define HAVE_PSIGNAL in libiberty/strsignal.c: line 550 does the trick.

#3) it did finish, reusing the $TMPDIR in build script, I did restart the script.
script installes most of the files to /gg/ instead of --prefix=/opt/ppc-warpos :/

#4) i just moved all those things from /opt/ppc-warpos to /gg/ ,
export PATH and it does work, nothing build with it, not yet patched to warpos
Code:
$ ppc-morphos-gcc-4 --version
ppc-morphos-gcc-4 (GCC/MorphOS) 4.4.5
whole thing build with cygwin 32bit gcc 6.4.0 (alias gcc-5 ...)

#5) in the current state of the toolchain build script, use this:
Code:
./toolchain-morphos --gcc gcc4 --prefix /gg
I've done so and everything went into the /gg/ folder tree.

Last edited by emufan; 12 February 2018 at 19:50.
emufan is offline  
Old 12 February 2018, 20:16   #110
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
now using Hedeon's mos2wos pack,
I think I need to build warpcollect on my cygwin system:
Code:
ppc-morphos-gcc-4 -warpup -O2 helloworld.c -o helloworld.exe
ppc-morphos-gcc-4: error trying to exec 
'/gg/lib/gcc-lib/ppc-morphos/4.4.5/warpcollect': execv: Exec format error

warpcollect: ELF 32-bit MSB relocatable, PowerPC or cisco 4500,
version 1 (SYSV), not stripped, with debug_info

/gg/bin/Elf2Exe2: AmigaOS loadseg()ble executable/binary
where can we find warpcollect/Elf2Exe2 src for hedeons's pack?

#1) no elf2exe2, now I remember a discussion about the missing src.
Code:
Future:

- If the Elf2Exe2 source can be supplied, any host with target ppc-morphos
  could compile also for WarpOS. Please let me know if you have it or know
  where to find it (It actually already can. but you would have to invoke
  Elf2Exe2 manually).
#2) hmm, rather strange. using "-c" option, produces a ELF binary.
should build object file with that option.
Code:
/gg/bin/ppc-morphos-gcc-4 -warpup -O2 helloworld.c -c -o helloworld.exe

Last edited by emufan; 12 February 2018 at 20:38.
emufan is offline  
Old 12 February 2018, 20:23   #111
Marlon_
AmigaDev.com
 
Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
Quote:
Originally Posted by emufan View Post
now using Hedeon's mos2wos pack,
I think I need to build warpcollet on my cygwin system:
Code:
ppc-morphos-gcc-4: error trying to exec 
'/gg/lib/gcc-lib/ppc-morphos/4.4.5/warpcollect': execv: Exec format error

warpcollect: ELF 32-bit MSB relocatable, PowerPC or cisco 4500,
version 1 (SYSV), not stripped, with debug_info
Yeah, or change the spec-file so it just uses plain old "collect", then run elf2exe2 on the appropriate platform.
Marlon_ is offline  
Old 12 February 2018, 20:45   #112
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by Marlon_ View Post
Yeah, or change the spec-file so it just uses plain old "collect", then run elf2exe2 on the appropriate platform.
elf2exe2 itself is a warpos binary?
and I only need elf2exe2, if there is no warpcollect?
emufan is offline  
Old 12 February 2018, 20:46   #113
Marlon_
AmigaDev.com
 
Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
Quote:
Originally Posted by emufan View Post
elf2exe2 itself is a warpos binary?
and I only need elf2exe2, if there is no warpcollect?
All warpcollect does is run elf2exe2 to turn the elf-binary to hunk.
and unfortunately yes, warpcollectElf2exe2 is a warpos binary... and there's no source to be found anywhere.

Last edited by Marlon_; 12 February 2018 at 21:19.
Marlon_ is offline  
Old 12 February 2018, 20:50   #114
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by Marlon_ View Post
All warpcollect does is run elf2exe2 to turn the elf-binary to hunk.
ok, I see. but elf2exe2 does need warpos (powerup?) amiga system to run?
emufan is offline  
Old 12 February 2018, 20:51   #115
Marlon_
AmigaDev.com
 
Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
Quote:
Originally Posted by emufan View Post
ok, I see. but elf2exe2 does need warpos (powerup?) amiga system to run?
yup :/
Marlon_ is offline  
Old 12 February 2018, 20:52   #116
Marlon_
AmigaDev.com
 
Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
winuae + qemu-plugin + warpos works fine for that purpose though, and you need to try the compiled binary anyway. =)
Marlon_ is offline  
Old 12 February 2018, 20:54   #117
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by Marlon_ View Post
yup :/
Quote:
Originally Posted by Marlon_ View Post
winuae + qemu-plugin + warpos works fine for that purpose though, and you need to try the compiled binary anyway. =)
ok.
emufan is offline  
Old 12 February 2018, 20:58   #118
Marlon_
AmigaDev.com
 
Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
As stated before, this is a work in progress, and I am hoping the WarpOS guys would chip in and help make this into a complete toolchain for WarpOS some day. With the effort Bebbo has put in to make gcc produce hunk-file formatted binaries, it shouldn't be impossible to implement this in the MorphOS toolchain so we don't need the elf2exe. It won't be easy though and it's above my level.
Marlon_ is offline  
Old 12 February 2018, 21:05   #119
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by Marlon_ View Post
... need the elf2exe. It won't be easy though and it's above my level.
I cannot help here aswell, but I understand.
I run elf2exe2 and got some error:
Code:
Elf2Exe2 helloworld.exe helloworld2.exe 
Error: Undefined Symbol: printf
Error: Error processing Elffile !

helloworld.exe build with:
/gg/bin/ppc-morphos-gcc-4 -warpup -O2 helloworld.c -c -o helloworld.exe
maybe the resulting helloworld.exe is not really valid, build that way.
emufan is offline  
Old 12 February 2018, 21:16   #120
Hedeon
Semi-Retired
 
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 1,993
Hi,

warpcollect source is available, not the one for Elf2Exe2.

I'm not sure what you mean by -c and object file/ELF binary. Object files (.o) are in ELF format.

When -c is used libcwos.a is not linked (which contains printf).

You should omit -c when producing ELF executables. Then libcwos gets linked then Elf2Exe2 has a valid target.

Quote:
Originally Posted by Marlon_ View Post
All warpcollect does is run elf2exe2 to turn the elf-binary to hunk.
and unfortunately yes, warpcollect is a warpos binary... and there's no source to be found anywhere.
Hedeon is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
emufan can you please port this to Amiga!!? xboxown Coders. C/C++ 93 29 November 2017 09:06
Just curious; Graphics Card Sim085 support.Hardware 31 12 October 2017 15:27
Curious about Natami Pat the Cat Amiga scene 13 07 January 2017 22:16
Hey hey, new guy here... CarlosTex Member Introductions 4 05 August 2011 01:29
hey hey 16k Amiga1992 Nostalgia & memories 5 16 August 2006 22:26

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:52.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.13911 seconds with 14 queries