[MacPorts] #62468: _sasl_locate_entry() in Cyrus SASL's lib/dlopen.c assumes a leading underscore is needed for calls to dlsym()

MacPorts noreply at macports.org
Wed Mar 17 01:01:07 UTC 2021


#62468: _sasl_locate_entry() in Cyrus SASL's lib/dlopen.c assumes a leading
underscore is needed for calls to dlsym()
---------------------------------------------+--------------------
  Reporter:  steven-michaud                  |      Owner:  (none)
      Type:  defect                          |     Status:  new
  Priority:  Normal                          |  Milestone:
 Component:  ports                           |    Version:
Resolution:                                  |   Keywords:
      Port:  cyrus-sasl2 @2.1.27_2+kerberos  |
---------------------------------------------+--------------------

Comment (by kencu):

 You probably don't. You probably see this:
 {{{
 configure:15333: checking whether dlsym adds the underscore for us
 configure:15355: /usr/bin/clang -o conftest -Wall -W -pipe -Os
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64
 -I/opt/local/include
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
 -L/opt/local/lib -Wl,-headerpad_max_install_names
 -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch
 x86_64 conftest.c  -ldl >&5
 conftest.c:37:18: warning: unused variable 'i' [-Wunused-variable]
 void foo() { int i=0;}
                  ^
 conftest.c:40:23: error: implicitly declaring library function 'exit' with
 type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-
 declaration]
     if(ptr1 && !ptr2) exit(0); } exit(1); }
                       ^
 conftest.c:40:23: note: include the header <stdlib.h> or explicitly
 provide a declaration for 'exit'
 1 warning and 1 error generated.
 configure:15355: $? = 1
 configure: program exited with status 1
 }}}

 which is what I see on BigSur, and that exit status 1 is what gives the
 (incorrect) failure that leads to the issue, by defining this:
 {{{
 #define DLSYM_NEEDS_UNDERSCORE /**/
 }}}
 because if (falsely) thinks it is needed.

 The fix is to do exactly what it says to do:
 {{{
 include the header <stdlib.h> or explicitly provide a declaration for
 'exit'
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/62468#comment:18>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list