LMS-Community / slimserver-vendor

Third-party software used with Lyrion Music Server
https://lyrion.org
42 stars 68 forks source link

Apparently overly pessimistic warning comparing gcc with perl's cc #44

Closed mw9 closed 6 years ago

mw9 commented 6 years ago

I am getting warnings about the identity of the compiler:

On Mac OSX, Perl 5.18 & Perl 5.26:

********************************************** WARNING *************************************
*                                                                                          *
*    Perl was compiled with cc,
*    which is different than gcc.
*    This may cause significant problems.                                                  *
*                                                                                          *
* Press CTRL^C to stop the build now...                                                    *
********************************************************************************************

On Debian Stretch, Perl 5.24:

********************************************** WARNING *************************************
*                                                                                          *
*    Perl was compiled with arm-linux-gnueabi-gcc,
*    which is different than gcc.
*    This may cause significant problems.                                                  *
*                                                                                          *
* Press CTRL^C to stop the build now...                                                    *
********************************************************************************************

The warning on Debian is almost certainly false:

realpath `which arm-linux-gnueabi-gcc`
/usr/bin/arm-linux-gnueabi-gcc-6
realpath `which gcc`
/usr/bin/arm-linux-gnueabi-gcc-6

Is this just a false alarm on Debian ?

The guts of the test were introduced here: https://github.com/Logitech/slimserver-vendor/commit/cb7e0ad0e28d685c1a699f5aad9e92bfb1347807

mherger commented 6 years ago

@fsbruva - I'd agree with @mw9. This hasn't been a problem for a decade. Don't know why this suddenly should cause issues? Can you elaborate?

fsbruva commented 6 years ago

I noticed build inconsistencies when buildme used a truly different compiler than was used to build Perl. The test I implemented obviously confuses more than it helps. EDIT: I will submit a PR to remove the test and misleading message.

mw9 commented 6 years ago

One approach might be to initialize GCC as follows:

GCC=`$PERL_BIN -V | grep "cc='" | sed "s#.*cc='##g" | sed "s#'.*##g"

But how does one then figure out the 'correct' matching G++ and GPP ? I suspect that this won't work, but I don't know enough about compiler toolkits.

fsbruva commented 6 years ago

@mw9 I appreciate the suggestion, and you are asking the absolute correct question. (The one I should have asked before I "fixed" anything). In reality, we don't need the compilers to be exactly the same - but probably the same family (clang vs. gcc) is good enough. When I submitted cb7e0ad, I was not testing on Linux, so didn't catch this.

This test is only meaningful for people who are compiling their own Perl from source with a compiler that differs from the system compiler. This is a corner case within a corner case. For these users, altering the build environment between compiling Perl and running buildme.sh is a situation of caveat lector, best handled in the README. Said another way, this is a misleading nuisance warning for ~99.88% of users. I feel it would be better to document the risk in the README, and remove the test.

To simplify merging, I will delay submission of a fix for this issue until my other two PR's are adjudicated.