[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Compiler flag detection doesn't work

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Fri, 28 Feb 2014 21:55:30 +0000

In configure.as we attempt to add compiler flags by detecting whether or
not the compiler accepts them. It's unreliable on Solaris:

    SVN_CFLAGS_ADD_IFELSE([-fno-inline])
    SVN_CFLAGS_ADD_IFELSE([-fno-omit-frame-pointer])

$ touch x.c
$ cc -c -fno-omit-frame-pointer x.c
cc: Warning: Option -fomit-frame-pointer passed to ld, if ld is invoked, ignored otherwise
"x.c", line 1: warning: empty translation unit
$ echo $?
0

I think that counts as working as far as SVN_CFLAGS_ADD_IFELSE is
concerned, these flags certainly get added.

However adding these flags causes the compiler to fail to link:

$ echo 'int main(){}' > x.c
$ cc -fomit-frame-pointer x.c
cc: Warning: Option -fomit-frame-pointer passed to ld, if ld is invoked, ignored otherwise
ld: fatal: option -f and building a dynamic executable are incompatible
ld: fatal: Flags processing errors

So we have to get SVN_CFLAGS_ADD_IFELSE to recognise that these flags
should not be added. I suppose we could change the AC_COMPILE_IFELSE to
an AC_LINK_IFELSE.

-- 
Philip Martin | Subversion Committer
WANdisco // *Non-Stop Data*
Received on 2014-02-28 22:56:06 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.