View Issue Details

IDProjectCategoryView StatusLast Update
0003584libmicrohttpdbuild systempublic2021-09-02 17:54
Reportertomasheran Assigned ToChristian Grothoff  
PrioritynormalSeveritytweakReproducibilityalways
Status closedResolutionfixed 
Platformx86/sparcOSSunOSOS Version5.11
Product Version0.9.37 
Target Version0.9.39Fixed in Version0.9.39 
Summary0003584: Solaris Studio linker complains about -fvisibility=hidden and -fno-strict-aliasing
DescriptionConfigure is testing whether -fno-strict-aliasing and -fvisibility=hidden is supported by cc and while Solaris Studio cc prints only warning like this:

cc: Warning: Option -fno-strict-aliasing passed to ld, if ld is invoked, ignored otherwise

the ld later issues a fatal error as follows:

ld: fatal: option '-fno-strict-aliasing' is incompatible with building a dynamic executable
Steps To ReproduceUse Solaris Studio instead of gcc.
TagsNo tags attached.

Activities

Christian Grothoff

2014-12-20 00:00

manager   ~0008714

For visibility, we check if the compiler "supports" it, if your compiler just ignores it, well, you may have a few more exported symbols, but should not be a big deal. Will look into linker now...


HIDDEN_VISIBILITY_CFLAGS=""
case "$host" in
  *-*-mingw*)
    dnl on mingw32 we do -fvisibility=hidden and __declspec(dllexport)
    AC_DEFINE([_MHD_EXTERN], [__attribute__((visibility("default"))) __declspec(dllexport) extern],
              [defines how to decorate public symbols while building])
    HIDDEN_VISIBILITY_CFLAGS="-fvisibility=hidden"
    ;;
  *)
    dnl on other compilers, check if we can do -fvisibility=hidden
    AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],
                           [AC_DEFINE([_MHD_EXTERN], [__attribute__((visibility("default"))) extern],
                                       [defines how to decorate public symbols while building])
                            HIDDEN_VISIBILITY_CFLAGS="-fvisibility=hidden"])
    ;;
esac
AC_SUBST(HIDDEN_VISIBILITY_CFLAGS)

Christian Grothoff

2014-12-20 00:17

manager   ~0008715

Tried to fix the -fno-strict-aliasing issue in SVN 34712. Please report back if it works!

tomasheran

2014-12-21 20:52

reporter   ~0008722

The issue with -fvisibility=hidden is the same as with the -fno-strict-aliasing - the cc issues a warning about ignoring it, but then the linker trips over it later. It wasn't too clear from my description, for which I am sorry.

I confirm though that the fix for -fno-strict-aliasing does work as expected.

Christian Grothoff

2014-12-22 13:05

manager   ~0008723

Ok, I've done the same for the visibility option in SVN 34748. Calling this 'resolved', please re-open if not.

Christian Grothoff

2021-09-02 17:54

manager   ~0018201

Fix committed to master branch.

Related Changesets

libmicrohttpd: master 00a5e292

2014-12-20 01:17

Christian Grothoff


Details Diff
trying to fix 0003584 Affected Issues
0003584
mod - configure.ac Diff File
add - m4/ax_append_link_flags.m4 Diff File
add - m4/ax_check_link_flag.m4 Diff File

libmicrohttpd: master 87c2472e

2014-12-22 14:04

Christian Grothoff


Details Diff
-fix 0003584 Affected Issues
0003584
mod - ChangeLog Diff File
mod - configure.ac Diff File

Issue History

Date Modified Username Field Change
2014-12-19 13:04 tomasheran New Issue
2014-12-20 00:00 Christian Grothoff Note Added: 0008714
2014-12-20 00:05 Christian Grothoff Assigned To => Christian Grothoff
2014-12-20 00:05 Christian Grothoff Status new => assigned
2014-12-20 00:17 Christian Grothoff Note Added: 0008715
2014-12-20 00:17 Christian Grothoff Status assigned => feedback
2014-12-21 20:52 tomasheran Note Added: 0008722
2014-12-21 20:52 tomasheran Status feedback => assigned
2014-12-22 13:05 Christian Grothoff Note Added: 0008723
2014-12-22 13:05 Christian Grothoff Status assigned => resolved
2014-12-22 13:05 Christian Grothoff Fixed in Version => 0.9.39
2014-12-22 13:05 Christian Grothoff Resolution open => fixed
2014-12-22 13:05 Christian Grothoff Target Version => 0.9.39
2014-12-22 16:40 Christian Grothoff Status resolved => closed
2021-09-02 17:54 Christian Grothoff Changeset attached => libmicrohttpd master 87c2472e
2021-09-02 17:54 Christian Grothoff Changeset attached => libmicrohttpd master 00a5e292
2021-09-02 17:54 Christian Grothoff Note Added: 0018201