Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS: Permission errors #194

Open
m4rkus opened this issue Dec 21, 2022 · 15 comments
Open

MacOS: Permission errors #194

m4rkus opened this issue Dec 21, 2022 · 15 comments

Comments

@m4rkus
Copy link

m4rkus commented Dec 21, 2022

Thanks a lot for the macOS support! There seems to be some kind of file permission problem with the extension.
I get this (VS Code Version: 1.74.0, macOS 13.0.1 (22A400), Apple Silicon) when compiling the test-project:

Compiling main.c
make: m68k-amiga-elf-gcc: Permission denied
Compiling support/gcc8_c_support.c
make: m68k-amiga-elf-gcc: Permission denied
make: *** [obj/main.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [obj/gcc8_c_support.o] Error 1

 *  The terminal process "/bin/zsh '-c', 'make -j4 program=out/a'" failed to launch (exit code: 2). 
@m4rkus
Copy link
Author

m4rkus commented Dec 21, 2022

Manually changing permissions solved it of course but assume that it should work out of the box :)

@BartmanAbyss
Copy link
Owner

@grahambates Did I forget to change path names somewhere?

@grahambates
Copy link
Contributor

No, the path names which contained version numbers were wrong at some point, but that was fixed before the current release.

What's supposed to happen is that the extension chmods all the binaries on startup as the package is built on Windows and doesn't preserve permissions. Perhaps that's failing for some reason. @m4rkus did you see any error messages / output in VS Code to that effect?

@m4rkus
Copy link
Author

m4rkus commented Dec 21, 2022

@grahambates Yes, don't remember exactly but it failed to resolve the path cc1 or something like that. I reinstalled the extension to find out what the exact error message was, but now I cannot reproduce the problem 🙃

@grahambates
Copy link
Contributor

I'm a bit stumped on this one. I'm wondering whether maybe it's happening in a specific state when updating from 1.6.7 -> 1.6.8 where it's running the new code, but still looking for the binaries in the old extension dir where the paths are different. If so this should hopefully be resolved by just restarting VS Code.

@akikoplays
Copy link

Hello all, I am so grateful that you made this available for MacOS. Thanks a bunch.

I have now updated to the latest 1.6.8, and initialized the demo project.
As mentioned before, there were the permission errors. I corrected that using chmod +x where necessary.

When I build the demo source from VS Code (F5) I get the following errors:

Compiling main.c
Compiling support/gcc8_c_support.c
Assembling support/gcc8_a_support.s
Assembling support/depacker_doynax.s
Assembling support/depacker_doynax_vasm.asm
clang: error: no such file or directory: 'obj/gcc8_a_support.o'
clang: error: no such file or directory: 'obj/depacker_doynax.o'
make: *** [obj/depacker_doynax.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [obj/gcc8_a_support.o] Error 1
clang: clang: warning: warning: argument unused during compilation: '-mcpu=68000' [-Wunused-command-line-argument]argument unused during compilation: '-mcpu=68000' [-Wunused-command-line-argument]

/var/folders/9m/mm7m7ts959q2mk_7m3y0bf940000gn/T//ccpPoZDj.s:3:11: error: mach-o section specifier uses an unknown section type
        .section        .gnu.debuglto_.debug_info,"",@progbits
                        ^
/var/folders/9m/mm7m7ts959q2mk_7m3y0bf940000gn/T//ccpPoZDj.s:5:2: error: unknown directive
        .weak   gcc8_c_support.c.aa08cc42
        ^ 

.... and so on, there goes hundreds of lines with similar content

I am running MacOS 13.2 Ventura, Silicon M1. I am using homebrew as a package manager (should that become relevant at some point..).

I have tried to run manually the same thing ( I've exported the SDKDIR respectively):


clang: error: unsupported option '--register-prefix-optional'
clang: error: no such file or directory: 'gcc8_a_support.o'

Have you maybe encountered this already? Is there some dependency I am missing? Or further tempering necessary?
Thanks in advance

@BartmanAbyss
Copy link
Owner

shouldn't execute any clang while compiling amiga stuff...

@akikoplays
Copy link

akikoplays commented Jan 26, 2023

That's what puzzled me and why I tried to reproduce it manually invoking the provided executable:

./m68k-amiga-elf-gcc -g -MP -MMD -m68000 -Ofast -nostdlib -Wextra -Wno-unused-function -Wno-volatile-register-var -fomit-frame-pointer -fno-tree-loop-distribution -flto -fwhole-program -fno-exceptions -Wa,-g,--register-prefix-optional,-I$SDKDIR,-D -c ~/temp/bartmann/support/gcc8_a_support.s -o ~/temp/gcc8_a_support.o

And still getting the same clang warning:

clang: error: unsupported option '--register-prefix-optional'
clang: error: no such file or directory: '/Users/x/temp/gcc8_a_support.o'

@BartmanAbyss
Copy link
Owner

I think even m68k-amiga-elf-gcc is just a wrapper that calls libexec/gcc/m68k-amiga-elf/12.2.0/cc1. at least it should. However I don't know anything about MacOS so we'd probably have to ask @grahambates .

@grahambates
Copy link
Contributor

grahambates commented Jan 26, 2023

I'd guess that some of the other bundled binaries are still not executable and it's falling back to a system version on your path.

@grahambates
Copy link
Contributor

Make sure you chmod +x all the following:

elf2hunk
exe2adf
fs-uae/fs-uae
opt/bin/*
opt/libexec/gcc/m68k-amiga-elf/12.2.0/*
opt/m68k-amiga-elf/bin/*
Shrinkler
vasmm68k_mot

@grahambates
Copy link
Contributor

Also make sure the relevant dirs are in your path when building manually. You can use the Amiga: Open terminal command to get a shell with these already set up.

@akikoplays
Copy link

@grahambates Thank you kindly for the swift reply, I managed to compile and run the demo code.

It was my mistake, I didn't see correctly while listing that the opt/m68k-amiga-elf was a directory and not file, so I didn't step into it and of course chmod +x was missing on the all the binaries in there. Sorry for the fuss.

Once again @BartmanAbyss it's an awesome job you did with this extension and @grahambates porting to MacOS.

@grahambates
Copy link
Contributor

No problem! Glad you got it working.

@pmprog
Copy link

pmprog commented Oct 26, 2023

Just in case you aren't aware, the executable flag is missing when you install the VSIX on a Linux box too
Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants