On Sat, Jul 23, 2016 at 3:14 PM, Benoît CANET <ben...@irqsave.net> wrote:

>
> Tested it I still have compilation issues on Fedora24.
>

This patch was only one of a dozen patches I sent in the last couple of
days to fix compilation issues with gcc 6 - all of them are needed together
to get OSv to compile with gcc 6.

So far, I see Pekka committed just one of these patches. If there are no
objections to these patches, I'll commit the rest myself later tonight.


>
>   CXX loader.cc
> In file included from loader.cc:21:0:
> arch/common/smp.hh:14:62: error: constructor priorities must be integers
> from 0 to 65535
> inclusive
> void smp_init() __attribute__((constructor(init_prio::sched)));
>                                                              ^
> In file included from include/osv/timer-set.hh:14:0,
>                 from include/osv/sched.hh:27,
>                 from arch/common/smp.hh:11,
>                 from loader.cc:21:
> include/osv/bitset-iter.hh:60:8: error: 'size_t
> bitsets::count_trailing_zeros(T) [with T
> = long int]' defined but not used [-Werror=unused-function]
> size_t count_trailing_zeros<long>(long value)
>        ^~~~~~~~~~~~~~~~~~~~~~~~~~
> include/osv/bitset-iter.hh:54:8: error: 'size_t
> bitsets::count_trailing_zeros(T) [with T
> = long unsigned int]' defined but not used [-Werror=unused-function]
> size_t count_trailing_zeros<unsigned long>(unsigned long value)
>        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/osv/bitset-iter.hh:48:8: error: 'size_t
> bitsets::count_leading_zeros(T) [with T =
> long int]' defined but not used [-Werror=unused-function]
> size_t count_leading_zeros<long>(long value)
>        ^~~~~~~~~~~~~~~~~~~~~~~~~
> include/osv/bitset-iter.hh:42:8: error: 'size_t
> bitsets::count_leading_zeros(T) [with T =
> long unsigned int]' defined but not used [-Werror=unused-function]
> size_t count_leading_zeros<unsigned long>(unsigned long value)
>        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> cc1plus: all warnings being treated as errors
> Makefile:372: recipe for target 'build/release.x64/loader.o' failed
> make: *** [build/release.x64/loader.o] Error 1
> [benoit@scylla osv]$ ^C
> [benoit@scylla osv]$
>
>
> 2016-07-22 20:32 GMT+02:00 Nadav Har'El <n...@scylladb.com>:
>
>> Starting with gcc 6, some of the C++ header files like <cmath> and
>> <cstdlib>
>> assume (by using the non-standard preprocessor directive "#include_next")
>> that the C headers come *later* in the header file search path. This
>> assumption is explained in https://gcc.gnu.org/gcc-6/porting_to.html and
>> in
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70722.
>>
>> OSv breaks this assumption by putting our own C header files in the search
>> path, so those will now be *before* the C++ header files (which are last,
>> being on the default search path), breaking the C++ header files'
>> assumption.
>> Those will now wrong include the system's standard header files instead of
>> OSv's, and compilation will fail.
>>
>> To fix this, we must explicitly list the C++ header directory or
>> directories
>> in our compilation line, before the C headers (include/api).
>>
>> We find the C++ header directories by running the C++ compiler to figure
>> out its default header search path, and look for those with "c++" in the
>> name. Usually this will include /usr/include/c++/<version> and also
>> /usr/include/c++/<version>/<arch>.
>>
>> Fixes #768
>>
>> Signed-off-by: Nadav Har'El <n...@scylladb.com>
>> ---
>>  Makefile | 8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/Makefile b/Makefile
>> index 530e9a5..abc7a8f 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -261,6 +261,14 @@ INCLUDES += -isystem $(libfdt_base)
>>  endif
>>
>>  INCLUDES += $(boost-includes)
>> +ifeq ($(gcc_include_env), host)
>> +# Starting in Gcc 6, the standard C++ header files (which we do not
>> change)
>> +# must precede in the include path the C header files (which we replace).
>> +# This is explained in
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70722.
>> +# So we are forced to list here (before include/api) the system's default
>> +# C++ include directories, though they are already in the default search
>> path.
>> +INCLUDES += $(shell $(CXX) -E -xc++ - -v </dev/null 2>&1 | awk '/^End/
>> {exit} /^ .*c\+\+/ {print "-isystem" $$0}')
>> +endif
>>  INCLUDES += -isystem include/api
>>  INCLUDES += -isystem include/api/$(arch)
>>  ifeq ($(gcc_include_env), external)
>> --
>> 2.5.5
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "OSv Development" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to osv-dev+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to