Lahfa Samy wrote:
> Hey so here is what I found out about the error and solved it, it was 
> actually making this error because the folder named 'cp' exists, as soon 
> as I renamed the folder 'cp' to something else, the build got working 
> again.

Good find! Where did that 'cp' folder exist?


> Very weird issue, if anyone has an idea why it happened, my shell being 
> used is ZSH.

It actually makes sense. Most systems don't treat program binaries
specially, they are usually just files, ie. entries in directories.

Commands issued to the system are searched in the PATH directories.

If there's an entry with the sought name in a PATH directory then
it's not so wrong to try to execute it, although obviously directories
can't ever be executed successfully.



Karl Semich wrote:
> I was able to reproduce your error with:

Thanks for the reproducer.


> sudo mkdir /usr/local/bin/asdf
> echo -e 'all:\n\tasdf' > Makefile
> make
> 
> I have gnu make 4.3 .
> 
> This could be considered a bug with gnu make, trying to execute
> directories. Ideally it would be reported to them and a fix
> contributed. It is likely very easy to fix.

make probably isn't actively choosing to do it.

$ sudo mkdir /usr/local/bin/asdf
$ bash -c asdf
bash: asdf: command not found
$ tcsh -c asdf
/usr/local/bin/asdf: Permission denied.
$ busybox sh -c asdf
sh: asdf: Permission denied
$ gcc -o /tmp/a.out -x c - << EOF
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int main(int argc, char *argv[]) {
        execlp("asdf", "asdf", NULL);
        perror("execlp");
        exit(EXIT_FAILURE);
}
EOF
$ /tmp/a.out
execlp: Permission denied
$ 

Based on the error messages and as confirmed with strace -f only bash
chooses to reject the subdirectory as a command while the other
programs probably just call execlp() or execvp(), so this is libc
behavior.


//Peter
_______________________________________________
coreboot mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to