Compiler error with U_FORTIFY_SOURCE, D_FORTIFY_SOURCE options

Joel Sherrill joel at rtems.org
Fri May 25 15:14:57 UTC 2018


On Fri, May 25, 2018 at 10:09 AM, Amaan Cheval <amaan.cheval at gmail.com>
wrote:

> Hi!
>
> I don't know the specifics of the thing you're talking about here, so
> others should definitely weigh in on that if they can, but regarding the
> header file; the include syntax used (<ssp.h>, as opposed to "ssp.h") is
> the one used for system header files (for eg. <stdio.h> vs "my_header.h").
>
> I see 2 possibilities:
> - The project expects these files to be in a standard include directory
> (such as /usr/include), which the compiler checks for system headers by
> default
> - You need to add the directory where ssp.h exists to the command-line
> flags for the compiler, for eg. through "gcc -I. ssp.c" (assuming ssp.c
> includes ssp.h, which exists in the same directory). See this for more:
> https://gcc.gnu.org/onlinedocs/gcc-6.4.0/cpp/Search-Path.html
>

I don't have an ssp.h on my Centos system and don't think it is a standard
.h file at all.
It isn't from POSIX or C Library for sure.

If it is in their source tree, then it should be "ssp.h" (or something that
picks up the file)
and the use of <> is broken. It isn't a standard header file.

Change it to "". If it works, submit a patch upstream and cc me on it.
Hopefully
they will just accept the patch and it won't be a long discussion.

>
>
> On Fri, May 25, 2018, 8:08 PM Udit agarwal <dev.madaari at gmail.com> wrote:
>
>> Hi all,
>> While cross-compiling fio for RTEMS, by default in the compiler call
>>
>>>  -U_FORTIFY_SOURCE   -D_FORTIFY_SOURCE=2
>>
>> options are used which raises the following error:
>>
>>> /home/uka_in/development/benchmark/sandbox/5/lib/gcc/
>>> arm-rtems5/7.3.0/include/ssp/unistd.h:38:10: fatal error: ssp.h: No
>>> such file or directory
>>>  #include <ssp.h>
>>>           ^~~~~~~
>>> compilation terminated.
>>> make: *** [crc/crc32c-arm64.o] Error 1
>>>
>>> However, ssp.h is in the same folder.
>> Without these options, only sys/unistd.h is included and not the
>> ssp/unistd.h. Any idea why these compiler opts are raising these error?
>>
>> Also, FIO needs a BSP independent method for determining the size of RAM
>> for it's internal working.  I'm unable to figure out any such
>> implementation. Any help on this too, would be great.
>>
>> Regards,
>> Udit agarwal
>> _______________________________________________
>> devel mailing list
>> devel at rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel
>
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20180525/c69bd8b3/attachment.html>


More information about the devel mailing list