English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. General (https://eab.abime.net/forumdisplay.php?f=37)
-   -   Can't make bebbo's amiga-gcc work (https://eab.abime.net/showthread.php?t=114693)

Bren McGuire 05 June 2023 15:46

Can't make bebbo's amiga-gcc work
 
i really need help here guys i have been trying to make this amiga-gcc by bebbo thing work and when i try to compile some code it says:
Code:

sh: /bin/sh: No such file or directory
sh: *** [Makefile:97: clean] Error 127

i am running windows 10, i downloaded the "Precompiled suite with installer" for windows with msys2 and i am stumped. why is it looking for sh? this isnt linux.

any help appreciated :sad:sad:sad

Samurai_Crow 05 June 2023 15:55

Msys2 comes with Bash so 'sh' should just use that. You might need to check the path.

bebbo 05 June 2023 18:00

Quote:

Originally Posted by Bren McGuire (Post 1620480)
i really need help here guys i have been trying to make this amiga-gcc by bebbo thing work and when i try to compile some code it says:
Code:

sh: /bin/sh: No such file or directory
sh: *** [Makefile:97: clean] Error 127

i am running windows 10, i downloaded the "Precompiled suite with installer" for windows with msys2 and i am stumped. why is it looking for sh? this isnt linux.

any help appreciated :sad:sad:sad


You have to open the command line via the provided `cmdline.bat`.
Or you have to provide a proper configuration by yourself.


It uses msys2, which is linux for windows and that uses sh.

Bren McGuire 05 June 2023 18:40

thanks for replying bebbo! I have msys2 installed
actually to make sure i went and installed it again a newer version i hope.
i opened cmdline.bat and cd to the folder where my code is and i still get the same error
what to do now? :(
Quote:

Originally Posted by bebbo (Post 1620509)
You have to open the command line via the provided `cmdline.bat`.
Or you have to provide a proper configuration by yourself.


It uses msys2, which is linux for windows and that uses sh.


paraj 05 June 2023 19:08

Did you install the toolchain in the default location? If not, try doing that (a path with spaces could causes issues).

In cmdline.bat try changing line 3 from
Code:

path %path%;%prefix%\bin\
to
Code:

path %prefix%\bin\;%path%
Just tried the default installation and it worked for me (on Windows 11), the above is just random guesses based on previous experience with msys based stuff.

jotd 05 June 2023 20:48

I never use that msys crap, only gnu make for windows & Bebbo's as / gcc and it works fine.

Bren McGuire 05 June 2023 22:05

i installed the toolchain in the default c:/amiga-gcc
Quote:

Originally Posted by paraj (Post 1620531)
Did you install the toolchain in the default location? If not, try doing that (a path with spaces could causes issues).

i did this and no change still same error :( i even added c:/msys64/usr/bin to PATH now
Quote:

In cmdline.bat try changing line 3 from
Code:

path %path%;%prefix%\bin\
to
Code:

path %prefix%\bin\;%path%


paraj 06 June 2023 17:15

1. Does e.g. m68k-amigaos-gcc.exe work on its own if you cd into c:/amiga-gcc/bin ?
2. Does sh.exe?
3. How about make.exe
4. What about a simpler Makefile that you create from scratch?
5. Check if the Makefile contains windows line endings (perhaps only some lines)
6. If all that fails, try attaching the Makefile

jotd 06 June 2023 17:38

cputest (WinUAE cpu tester) uses Bebbo's gcc toolchain but no shells or crap. Try building that, I could build it with only "make" command installed, no crap msys or sh (sources from WinUAE github in "cputest")

Bren McGuire 06 June 2023 21:21

1. amiga-gcc successfully compiles hello.c when i launch cmdline.bat so i am assuming its working
2. sh.exe works on its own when invoked from the command line
3. make when invoked on its own in any random dir says "sh: *** No targets specified and no makefile found. Stop."
4. i dont know how to make a makefile :(
5. they are all cr/lf
6. there is a line there that says
Code:

# The shell in which to execute make rules.
SHELL = /bin/sh

but no matter what i change this to, it still doesn't work, still tries to use sh


Quote:

Originally Posted by paraj (Post 1620754)
1. Does e.g. m68k-amigaos-gcc.exe work on its own if you cd into c:/amiga-gcc/bin ?
2. Does sh.exe?
3. How about make.exe
4. What about a simpler Makefile that you create from scratch?
5. Check if the Makefile contains windows line endings (perhaps only some lines)
6. If all that fails, try attaching the Makefile


Bren McGuire 06 June 2023 21:25

I tried this, still getting similar errors:
Code:

C:\amiga-gcc\cputest>make
sh: /bin/sh: No such file or directory
sh: /bin/sh: No such file or directory
/opt/amiga/bin/m68k-amigaos-gcc -mcrt=nix13 -O2 -m68000 -fomit-frame-pointer -msoft-float -DREVDATE="\"\"" -DREVTIME="\"\"" -DAMIGA -DM68K -I. -c -o main.o main.c
sh: /bin/sh: No such file or directory
sh: *** [makefile:20: main.o] Error 127

Quote:

Originally Posted by jotd (Post 1620758)
cputest (WinUAE cpu tester) uses Bebbo's gcc toolchain but no shells or crap. Try building that, I could build it with only "make" command installed, no crap msys or sh (sources from WinUAE github in "cputest")


bebbo 07 June 2023 08:45

The package setup-amiga-gcc.exe is intended to be used in Windows without installing MSYS2. It should also work having MSYS2.

I remember there was a problem with make and shell. That's why the cmdline.bat creates a wrapper for make.exe. The real make.exe was renamed to _make.exe. The new make.exe invokes _make.exe with setting SHELL=c:\amiga-gcc\bin\sh.exe

If you are using MSYS2 then you have to verify which make.exe is used. Also some of the DLLs may be duplicates or even worse: differ a bit.

Invoke a real make.exe - not the wrapper and maybe you have to provide the variable SHELL=....

You should remove all files in amiga-gcc/bin which are dups of files in MSYS2


Nowaday you shouldn't use MSYS2, you should use WSL2, which is soooooooooooooooooooooo much faster.

jotd 07 June 2023 18:02

Quote:

Originally Posted by Bren McGuire (Post 1620814)
I tried this, still getting similar errors:
Code:

C:\amiga-gcc\cputest>make
sh: /bin/sh: No such file or directory
sh: /bin/sh: No such file or directory
/opt/amiga/bin/m68k-amigaos-gcc -mcrt=nix13 -O2 -m68000 -fomit-frame-pointer -msoft-float -DREVDATE="\"\"" -DREVTIME="\"\"" -DAMIGA -DM68K -I. -c -o main.o main.c
sh: /bin/sh: No such file or directory
sh: *** [makefile:20: main.o] Error 127


use the proper make.exe. then there is stuff to change from command line. more later (on my phonE right now)

Bren McGuire 07 June 2023 18:10

i installed msys2 following some guide. i will uninstall it then.
as for the wsl i dont know if i have enough space in my drive to run a linux subsystem, will look into it

thanks all for your help so far

[edit] i uninstalled msys2 and i still get the same error trying to compile cputest

paraj 07 June 2023 20:01

Ah, I can reproduce you issue with just:
Code:

.PHONY: test
test:
        echo Hello!

This gives:
Code:

echo Hello!
sh: /bin/sh: No such file or directory
sh: *** [Makefile:3: test] Error 127

Adding "SHELL=sh" to the start of the makefile resolves it.

Not sure what's causing it, but I think you can work around it by using another version of "make" with the amiga-gcc distribution (needs to be earlier in the path obviously). I'm using the one from https://nuwen.net/mingw.html (for the gcc part) but YMMV.

Bren McGuire 08 June 2023 19:59

I went ahead with your advice so now i have un installed msys2 and I have a Debian install on Windows, but no idea how to proceed
what should I do? i am still getting the error
Quote:

Originally Posted by bebbo (Post 1620886)
Nowaday you shouldn't use MSYS2, you should use WSL2, which is soooooooooooooooooooooo much faster.


Bren McGuire 10 June 2023 16:04

anyone can help at this point? bebbo? :sad

jotd 10 June 2023 18:15

the version of "make" is at fault

Code:

K:\jff\AmigaHD\PROJETS\arcade_remakes\pengo\src>c:\amiga-gcc\bin\make.exe -v
GNU Make 4.4
Built for x86_64-pc-msys
Copyright (C) 1988-2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

K:\jff\AmigaHD\PROJETS\arcade_remakes\pengo\src>make -v
GNU Make 3.82
Built for i686-pc-mingw32
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

you need the one which isn't built for MSYS. I've zoned it

Bren McGuire 12 June 2023 01:09

i figured out how to make wsl2 work and now i can compile cputest ! i didnt realize i should follow instructions to make it work like if it was Linux because it is Linux :p


All times are GMT +2. The time now is 04:48.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.05902 seconds with 11 queries