help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Make opens Android Studio


From: Rakesh Sharma
Subject: Re: Make opens Android Studio
Date: Tue, 22 Mar 2016 12:28:44 +0000

Did you check your PATH variable? Why should a symlink in your home/bin to as 
modify the behavior
of your makefile unless home/bin is included in your PATH and that too earlier 
than the regular /usr/bin
etc. directories.

________________________________________
From: address@hidden <address@hidden> on behalf of Sideboard <address@hidden>
Sent: Tuesday, March 22, 2016 1:25 AM
To: Bob Proulx
Cc: address@hidden
Subject: Re: Make opens Android Studio

On 22.03.2016 01:08, Bob Proulx wrote:
>> > This also works with an alias 'as'.
> Are you sure?  Bash aliases are specific to bash interactive shells.

I just rechecked and apparently was wrong on that part. Probably
confused something last time with all the back-and-forth renaming and
realiasing.

>> > I'm not sure whether that is the intended behavior to keep it
>> > customizable or if some edge-case was overlooked. Should I report that
>> > to the gcc list?
> The gcc suite gcc, cpp, ld, as, and others, not a complete list, too.
> If any of those are overridden then the overridden versions will be
> called instead.  This is a very useful feature.
>
> I am not sure I have completely understood the nuance of your question
> but I don't see any behavior that is unexpected here.

I was surprised that a symlink from months ago that I didn't even know
about anymore changed the behavior of the compilation in such a dramatic
way while it was not obvious that this was the case. When creating the
symlink I probably didn't think about that there might be an important
program which would be overridden. Of course, it does make sense that
the PATH is used for all the different parts because maybe I really
wanted to switch my /usr/bin/as with a superior $HOME/bin/as, that's
what I meant with "customizable".

In my mind it might also have been the case that the different
compilation tools, while being separate programs but in the same suite,
are sticking together so that `gcc' always calls its very own `as'. You
would still be able to customize but only by exchanging the complete
package of `cpp', `gcc', `as', `ld' etc. In that case, the `as' being
overridden would have been unintended.

> It might be useful for you to create a very small C program and
> compile it with gcc -v to see all of the processing that goes on under
> the gcc hood.  Some things have become more internal to compilers for
> performance reasons but in the classic case one expects to see it
> invoke a C-preprocessor (cpp), followed by compiler (cc1) to assembly
> language, followed by assembler (as) to assemble to machine code,
> followed by link-editor (ld) to link into an executable or library.
> Implementations differ on exact details.

That's how I found out that `gcc' calls `as'. It even works without any
contents in the source code file. The problem in the `make' process
occurred when it made a "try-run" whether a compilation with a specific
compiler option runs without an error. The command was (cut down to the
essentials):
gcc -x c -c /dev/null -o "$TEMP_FILE"

Here '-x c' is necessary since gcc cannot guess from the file extension
what needs to be done. I repeated that by hand and included the -v
option. That's where I found the `as'.

Thanks again for all the help! I certainly will be more careful with the
choice of names in the future when I create files in the PATH. ;-)

Sideboard

_______________________________________________
Help-make mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-make



reply via email to

[Prev in Thread] Current Thread [Next in Thread]