English Amiga Board


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

 
 
Thread Tools
Old 29 May 2018, 19:16   #841
lantus360
Registered User
 
Join Date: Feb 2013
Location: Olathe, Kansas
Posts: 178
-noixemul in the linker fixed it. thanks!
lantus360 is offline  
AdSense AdSense  
Old 04 June 2018, 15:21   #842
lantus360
Registered User
 
Join Date: Feb 2013
Location: Olathe, Kansas
Posts: 178
My exe compiled up just fine, but now i have another problem

any thoughts/help on trying to debug/fix an immediate hard crash on launch of my executable? (alternates between guru/winuae crash dump).

one thing i tried was to just stub out main() and return hello world and that crashes as well. stack size was set correctly. Im not even sure if my code is getting to main()

ideas are welcome. thanks!
lantus360 is offline  
Old 04 June 2018, 15:24   #843
Marlon_
Amiga Programmer

Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Sundsvall, Sweden
Age: 29
Posts: 378
Quote:
Originally Posted by lantus360 View Post
My exe compiled up just fine, but now i have another problem

any thoughts/help on trying to debug/fix an immediate hard crash on launch of my executable? (alternates between guru/winuae crash dump).

one thing i tried was to just stub out main() and return hello world and that crashes as well. stack size was set correctly. Im not even sure if my code is getting to main()

ideas are welcome. thanks!
have you set the emulator to use FPU or not? Did you define -msoft-float or -mhard-float on compile?
Marlon_ is offline  
Old 04 June 2018, 15:32   #844
bebbo
Registered User

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 275
hello-stdio.c
Code:
#include <stdio.h>

int main()
{
  puts("hello world!\n");
  return 0;
}
will build and run with all 3 (4?) supported libs:

Code:
m68k-amigaos-gcc -Os -Wall -fomit-frame-pointer  -o hello-stdio hello-stdio.c
m68k-amigaos-gcc  -mcrt=nix13 -Os -Wall -fomit-frame-pointer  -o hello-stdio.nix13 hello-stdio.c
m68k-amigaos-gcc  -noixemul -Os -Wall -fomit-frame-pointer  -o hello-stdio.nix hello-stdio.c
m68k-amigaos-gcc  -mcrt=clib2 -Os -Wall -fomit-frame-pointer  -o hello-stdio.clib2 hello-stdio.c
bebbo is offline  
Old 04 June 2018, 15:36   #845
lantus360
Registered User
 
Join Date: Feb 2013
Location: Olathe, Kansas
Posts: 178
Quote:
Originally Posted by Marlon_ View Post
have you set the emulator to use FPU or not? Did you define -msoft-float or -mhard-float on compile?
I tried a few of these, but let me go back and test one at a time. Ill let you know what i find
lantus360 is offline  
Old 04 June 2018, 15:38   #846
Marlon_
Amiga Programmer

Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Sundsvall, Sweden
Age: 29
Posts: 378
Quote:
Originally Posted by lantus360 View Post
I tried a few of these, but let me go back and test one at a time. Ill let you know what i find
Also worth to try with different optimizations (-O1, -O2, -O3, -Os)
Marlon_ is offline  
Old 04 June 2018, 21:28   #847
bebbo
Registered User

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 275
Quote:
Originally Posted by Marlon_ View Post
Also worth to try with different optimizations (-O1, -O2, -O3, -Os)
Don't be so superstitious!
bebbo is offline  
Old 04 June 2018, 21:28   #848
Marlon_
Amiga Programmer

Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Sundsvall, Sweden
Age: 29
Posts: 378
Quote:
Originally Posted by bebbo View Post
Don't be so superstitious!
Marlon_ is offline  
Old 05 June 2018, 23:51   #849
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 47
Posts: 410
libnix fails to build for me.
Code:
mkdir -p /opt/amiga/gcc6/m68k-amigaos/libnix/lib/libnix
mkdir -p build/libnix
echo 'void foo(){}' > build/libnix/x.c
if [ ! -e /opt/amiga/gcc6/m68k-amigaos/libnix/lib/libnix/ncrt0.o ]; then /opt/amiga/gcc6/bin/m68k-amigaos-gcc -c build/libnix/x.c -o /opt/amiga/gcc6/m68k-amigaos/libnix/lib/libnix/ncrt0.o; fi
if [ ! -e /opt/amiga/gcc6/m68k-amigaos/libnix/lib/libnix/libm.a ]; then /opt/amiga/gcc6/bin/m68k-amigaos-ar r /opt/amiga/gcc6/m68k-amigaos/libnix/lib/libnix/libm.a; fi
if [ ! -e /opt/amiga/gcc6/m68k-amigaos/libnix/lib/libnix/libnixmain.a ]; then /opt/amiga/gcc6/bin/m68k-amigaos-ar r /opt/amiga/gcc6/m68k-amigaos/libnix/lib/libnix/libnixmain.a; fi
if [ ! -e /opt/amiga/gcc6/m68k-amigaos/libnix/lib/libnix/libnix.a ]; then /opt/amiga/gcc6/bin/m68k-amigaos-ar r /opt/amiga/gcc6/m68k-amigaos/libnix/lib/libnix/libnix.a; fi
if [ ! -e /opt/amiga/gcc6/m68k-amigaos/libnix/lib/libnix/libnix20.a ]; then /opt/amiga/gcc6/bin/m68k-amigaos-ar r /opt/amiga/gcc6/m68k-amigaos/libnix/lib/libnix/libnix20.a; fi
if [ ! -e /opt/amiga/gcc6/m68k-amigaos/libnix/lib/libnix/libstubs.a ]; then /opt/amiga/gcc6/bin/m68k-amigaos-ar r /opt/amiga/gcc6/m68k-amigaos/libnix/lib/libnix/libstubs.a; fi
mkdir -p /opt/amiga/gcc6/lib/gcc/m68k-amigaos/6.4.1b
if [ ! -e /opt/amiga/gcc6/lib/gcc/m68k-amigaos/6.4.1b/libgcc.a ]; then /opt/amiga/gcc6/bin/m68k-amigaos-ar r /opt/amiga/gcc6/lib/gcc/m68k-amigaos/6.4.1b/libgcc.a; fi
cd build/libnix && CFLAGS="-Os -g -fomit-frame-pointer" AR=m68k-amigaos-ar AS=m68k-amigaos-as CC=m68k-amigaos-gcc  /home/alex/t/amiga-gcc/projects/libnix/configure --prefix=/opt/amiga/gcc6/m68k-amigaos/libnix --target=m68k-amigaos --host=m68k-amigaos
checking for m68k-amigaos-CC... m68k-amigaos-gcc
checking whether the C compiler works... no
configure: error: in `/home/alex/t/amiga-gcc/build/libnix':
configure: error: C compiler cannot create executables
See `config.log' for more details
Makefile:530: recipe for target 'build/libnix/Makefile' failed
make: *** [build/libnix/Makefile] Error 77
Inside build/libnix/config.log
Code:
Configured with: /home/alex/t/amiga-gcc/projects/gcc/configure --prefix=/opt/amiga/gcc6 --target=m68k-amigaos --enable-languages=c,c++,objc --enable-version-specific-runtime-libs --disable-libssp --disable-nls
Thread model: single
gcc version 6.4.1b 20180605-075457 (GCC) 
configure:1917: $? = 0
configure:1906: m68k-amigaos-gcc -V >&5
m68k-amigaos-gcc: error: unrecognized command line option '-V'
m68k-amigaos-gcc: fatal error: no input files
compilation terminated.
configure:1917: $? = 1
configure:1906: m68k-amigaos-gcc -qversion >&5
m68k-amigaos-gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
m68k-amigaos-gcc: fatal error: no input files
compilation terminated.
configure:1917: $? = 1
configure:1937: checking whether the C compiler works
configure:1959: m68k-amigaos-gcc -Os -g -fomit-frame-pointer   conftest.c  >&5
/opt/amiga/gcc6/lib/gcc/m68k-amigaos/6.4.1b/../../../../m68k-amigaos/bin/ld: cannot open crt0.o: No such file or directory
collect2: error: ld returned 1 exit status
configure:1963: $? = 1
configure:2001: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:2006: error: in `/home/alex/t/amiga-gcc/build/libnix':
configure:2008: error: C compiler cannot create executables
alkis is offline  
Old 06 June 2018, 08:54   #850
bebbo
Registered User

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 275
Quote:
Originally Posted by alkis View Post
libnix fails to build for me.
Code:
mkdir -p /opt/amiga/gcc6/m68k-amigaos/libnix/lib/libnix
mkdir -p build/libnix
echo 'void foo(){}' > build/libnix/x.c
if [ ! -e /opt/amiga/gcc6/m68k-amigaos/libnix/lib/libnix/ncrt0.o ]; then /opt/amiga/gcc6/bin/m68k-amigaos-gcc -c build/libnix/x.c -o /opt/amiga/gcc6/m68k-amigaos/libnix/lib/libnix/ncrt0.o; fi
if [ ! -e /opt/amiga/gcc6/m68k-amigaos/libnix/lib/libnix/libm.a ]; then /opt/amiga/gcc6/bin/m68k-amigaos-ar r /opt/amiga/gcc6/m68k-amigaos/libnix/lib/libnix/libm.a; fi
if [ ! -e /opt/amiga/gcc6/m68k-amigaos/libnix/lib/libnix/libnixmain.a ]; then /opt/amiga/gcc6/bin/m68k-amigaos-ar r /opt/amiga/gcc6/m68k-amigaos/libnix/lib/libnix/libnixmain.a; fi
if [ ! -e /opt/amiga/gcc6/m68k-amigaos/libnix/lib/libnix/libnix.a ]; then /opt/amiga/gcc6/bin/m68k-amigaos-ar r /opt/amiga/gcc6/m68k-amigaos/libnix/lib/libnix/libnix.a; fi
if [ ! -e /opt/amiga/gcc6/m68k-amigaos/libnix/lib/libnix/libnix20.a ]; then /opt/amiga/gcc6/bin/m68k-amigaos-ar r /opt/amiga/gcc6/m68k-amigaos/libnix/lib/libnix/libnix20.a; fi
if [ ! -e /opt/amiga/gcc6/m68k-amigaos/libnix/lib/libnix/libstubs.a ]; then /opt/amiga/gcc6/bin/m68k-amigaos-ar r /opt/amiga/gcc6/m68k-amigaos/libnix/lib/libnix/libstubs.a; fi
mkdir -p /opt/amiga/gcc6/lib/gcc/m68k-amigaos/6.4.1b
if [ ! -e /opt/amiga/gcc6/lib/gcc/m68k-amigaos/6.4.1b/libgcc.a ]; then /opt/amiga/gcc6/bin/m68k-amigaos-ar r /opt/amiga/gcc6/lib/gcc/m68k-amigaos/6.4.1b/libgcc.a; fi
cd build/libnix && CFLAGS="-Os -g -fomit-frame-pointer" AR=m68k-amigaos-ar AS=m68k-amigaos-as CC=m68k-amigaos-gcc  /home/alex/t/amiga-gcc/projects/libnix/configure --prefix=/opt/amiga/gcc6/m68k-amigaos/libnix --target=m68k-amigaos --host=m68k-amigaos
checking for m68k-amigaos-CC... m68k-amigaos-gcc
checking whether the C compiler works... no
configure: error: in `/home/alex/t/amiga-gcc/build/libnix':
configure: error: C compiler cannot create executables
See `config.log' for more details
Makefile:530: recipe for target 'build/libnix/Makefile' failed
make: *** [build/libnix/Makefile] Error 77
Inside build/libnix/config.log
Code:
Configured with: /home/alex/t/amiga-gcc/projects/gcc/configure --prefix=/opt/amiga/gcc6 --target=m68k-amigaos --enable-languages=c,c++,objc --enable-version-specific-runtime-libs --disable-libssp --disable-nls
Thread model: single
gcc version 6.4.1b 20180605-075457 (GCC) 
configure:1917: $? = 0
configure:1906: m68k-amigaos-gcc -V >&5
m68k-amigaos-gcc: error: unrecognized command line option '-V'
m68k-amigaos-gcc: fatal error: no input files
compilation terminated.
configure:1917: $? = 1
configure:1906: m68k-amigaos-gcc -qversion >&5
m68k-amigaos-gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
m68k-amigaos-gcc: fatal error: no input files
compilation terminated.
configure:1917: $? = 1
configure:1937: checking whether the C compiler works
configure:1959: m68k-amigaos-gcc -Os -g -fomit-frame-pointer   conftest.c  >&5
/opt/amiga/gcc6/lib/gcc/m68k-amigaos/6.4.1b/../../../../m68k-amigaos/bin/ld: cannot open crt0.o: No such file or directory
collect2: error: ld returned 1 exit status
configure:1963: $? = 1
configure:2001: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:2006: error: in `/home/alex/t/amiga-gcc/build/libnix':
configure:2008: error: C compiler cannot create executables
no idea - all systems report no failure.

=> rinse and repeat

Code:
make clean clean-prefix -j
make update -j
make all -j4
bebbo is offline  
Old 06 June 2018, 10:50   #851
Hedeon
Sonnet Hacker

 
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 593
Isn't it complaining about missing one of the startup files that libnix needs to make an executable (crt0.o)?
Hedeon is offline  
Old 06 June 2018, 11:21   #852
bebbo
Registered User

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 275
Quote:
Originally Posted by Hedeon View Post
Isn't it complaining about missing one of the startup files that libnix needs to make an executable (crt0.o)?
Yes, it is. And thus newlib was not build.

rinse and repeat.
bebbo is offline  
Old 06 June 2018, 17:49   #853
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 47
Posts: 410
I had removed ira from the 'all" target of makefile. I did 'git checkout Makefile' to get the original makefile. Build breaks at building ira.

Something weird is going on.
Code:
make ira -n
mkdir -p build/ira
cd projects/ira && cc -o /home/alex/t/amiga-gcc/build/ira/ira -Os ira.c ira_2.c supp.c
mkdir -p /opt/amiga/gcc6/bin/
install build/ira/ira /opt/amiga/gcc6/bin/
echo "built /opt/amiga/gcc6/bin/ira"
echo "done" >build/ira/_done
!!!!????

Tries to make ira out of 3 files. If I cd to projects/ira and type make it builds!
Here's what make -n from within ira's folder says:
Code:
make -n
gcc -c -O2 -std=c99 -o obj/amiga_hunks.o  amiga_hunks.c
gcc -c -O2 -std=c99 -o obj/atari.o  atari.c
gcc -c -O2 -std=c99 -o obj/binary.o  binary.c
gcc -c -O2 -std=c99 -o obj/config.o  config.c
gcc -c -O2 -std=c99 -o obj/constants.o  constants.c
gcc -c -O2 -std=c99 -o obj/elf.o  elf.c
gcc -c -O2 -std=c99 -o obj/init.o  init.c
gcc -c -O2 -std=c99 -o obj/ira.o  ira.c
gcc -c -O2 -std=c99 -o obj/ira_2.o  ira_2.c
gcc -c -O2 -std=c99 -o obj/megadrive.o  megadrive.c
gcc -c -O2 -std=c99 -o obj/opcode.o  opcode.c
gcc -c -O2 -std=c99 -o obj/supp.o  supp.c
gcc -o ira obj/amiga_hunks.o obj/atari.o obj/binary.o obj/config.o obj/constants.o obj/elf.o obj/init.o obj/ira.o obj/ira_2.o obj/megadrive.o obj/opcode.o obj/supp.o
*very confused*
alkis is offline  
Old 06 June 2018, 18:01   #854
bebbo
Registered User

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 275
Quote:
Originally Posted by alkis View Post
I had removed ira from the 'all" target of makefile. I did 'git checkout Makefile' to get the original makefile. Build breaks at building ira.

Something weird is going on.
Code:
make ira -n
mkdir -p build/ira
cd projects/ira && cc -o /home/alex/t/amiga-gcc/build/ira/ira -Os ira.c ira_2.c supp.c
mkdir -p /opt/amiga/gcc6/bin/
install build/ira/ira /opt/amiga/gcc6/bin/
echo "built /opt/amiga/gcc6/bin/ira"
echo "done" >build/ira/_done
!!!!????

Tries to make ira out of 3 files. If I cd to projects/ira and type make it builds!
Here's what make -n from within ira's folder says:
Code:
make -n
gcc -c -O2 -std=c99 -o obj/amiga_hunks.o  amiga_hunks.c
gcc -c -O2 -std=c99 -o obj/atari.o  atari.c
gcc -c -O2 -std=c99 -o obj/binary.o  binary.c
gcc -c -O2 -std=c99 -o obj/config.o  config.c
gcc -c -O2 -std=c99 -o obj/constants.o  constants.c
gcc -c -O2 -std=c99 -o obj/elf.o  elf.c
gcc -c -O2 -std=c99 -o obj/init.o  init.c
gcc -c -O2 -std=c99 -o obj/ira.o  ira.c
gcc -c -O2 -std=c99 -o obj/ira_2.o  ira_2.c
gcc -c -O2 -std=c99 -o obj/megadrive.o  megadrive.c
gcc -c -O2 -std=c99 -o obj/opcode.o  opcode.c
gcc -c -O2 -std=c99 -o obj/supp.o  supp.c
gcc -o ira obj/amiga_hunks.o obj/atari.o obj/binary.o obj/config.o obj/constants.o obj/elf.o obj/init.o obj/ira.o obj/ira_2.o obj/megadrive.o obj/opcode.o obj/supp.o
*very confused*
... well, I thought "git pull" is standard...
... recipe updated:
Code:
git pull
make clean clean-prefix -j 
make update -j 
make all -j4
The separation of 'git pull' and 'make update' may sound illogical but it is and helps me a lot to work with branches here and there.
bebbo is offline  
Old 06 June 2018, 18:29   #855
alkis
Registered User

 
Join Date: Dec 2010
Location: Athens/Greece
Age: 47
Posts: 410
Yeap, that was it (git pull)

Thanks!
alkis is offline  
AdSense AdSense  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
New GCC based dev toolchain for AmigaOS 3.x cla Coders. Releases 8 24 December 2017 10:18
Issue with photon/xxxx WinUAE Toolchain arpz Coders. Asm / Hardware 2 26 September 2015 22:33
New 68k gcc toolchain arti Coders. C/C++ 17 31 July 2015 03:59
Hannibal's WinUAE Demo Toolchain 5 Bobic Amiga scene 1 23 July 2015 21:04
From gcc to vbcc. Cowcat Coders. General 9 06 June 2014 14:45

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:19.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.09978 seconds with 15 queries