This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Newlib fails to compile on arm64


On 16/06/18 04:38, Ajay Garg wrote:
Hi All.

I did the following :

##########################################################
git clone git://sourceware.org/git/newlib-cygwin.git
cd newlib-cygwin/newlib
./configure
make
##########################################################


However, the compilation fails to complete.
Upon seeing the logs somewhat before, errors of the following type are seen :

##########################################################
/newlib-cygwin/newlib/libc/include/ssp/ssp.h:47:52: error: expected
declaration specifiers or '...' before numeric constant
  #define __ssp_bos0(ptr) __builtin_object_size(ptr, 0)
##########################################################


What am I missing?


newlib is broken with -D_FORTIFY_SOURCE

stdio.h has macros like:

#define gets(str) \
    __gets_chk(str, __ssp_bos(str))

and gets.c does not protect the definition against macro expansion:

char *
gets (char *buf)
{
...

and for some reason ubuntu gcc -O2 turns -D_FORTIFY_SOURCE=2 on.

i think CC='gcc -D_FORTIFY_SOURCE=0' should work.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]