Re: [PATCH 1/1] libselinux, libsemanage: remove *swig_python_exception.i if its creation failed

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

 



On 07/11/16 22:19, William Roberts wrote:
> On Nov 7, 2016 13:03, "Stephen Smalley" <sds@xxxxxxxxxxxxx
> <mailto:sds@xxxxxxxxxxxxx>> wrote:
>>
>> On 11/05/2016 05:24 PM, Nicolas Iooss wrote:
>> > When compiling libselinux with CC=clang, "make pywrap" reports the
>> > following message:
>> >
>> >     bash exception.sh > selinuxswig_python_exception.i
>> >     clang-3.9: error: no such file or directory: 'temp.aux'
>> >     awk: fatal: cannot open file `temp.aux' for reading (No such file or
>> >     directory)
>> >
>> > This does not make the build fail as exception.sh returns an "OK"
>> > status. Use "bash -e" with this script to make it return an error value.
>> >
>> > In order not to keep an empty selinuxswig_python_exception.i file after
>> > a build fails (which would make a second run of "make pywrap"
> incorrectly
>> > succeed), remove the file when exception.sh fails.
>> >
>> > As libsemanage uses the same code to build
>> > semanageswig_python_exception.i, modify its Makefile too.
>> >
>> > By the way, on Linux clang does not seem to currently support -aux-info
>> > so it cannot be used to craft selinuxswig_python_exception.i.
>>
>> Thanks, applied all three.  Maybe we need to just always set CC to gcc
>> in exception.sh?
>>
> 
> What if you don't have GCC? We should support CC consistently and not
> set it under the hood IMHO.

There are also valid scenarios where exception.sh works without CC being
gcc, for example when cross-compiling with CC=arm-....-gcc, or building
with wrappers like CC=musl-gcc, etc.
What about using gcc as a fallback if $CC did not work? i.e. something
like this in exception.sh:

if ! ${CC:-gcc} -x c -c -I../include - -aux-info .... ; then
    # clang does not support -aux-info so fall back to gcc
    gcc -x c -c -I../include - -aux-info ....
fi

Nicolas
_______________________________________________
Selinux mailing list
Selinux@xxxxxxxxxxxxx
To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx.
To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.



[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux