On Fri, Oct 13, 2023 at 07:51:17AM +0200, Robert Nagy wrote:
> Is having unwind.h in !sparc64 going to cause any breakage?

I honestly have no idea. I don't know what exactly your commit

https://github.com/openbsd/ports/commit/2a0e3678f1ba1beaada027f5f9a2405b3e0cce96

was supposed to be fixing.

/usr/include/unwind.h is present in the distrib/sets/comp/md.* files for
the gcc architectures, but we only care about sparc64 here.

I would be inclinded to leave the header in place (which is what my diff
does) and think about removing it from the llvm port if we find actual
breakage related to it.

> 
> On 12/10/23 22:18 +0200, Theo Buehler wrote:
> > As can be seen in [1], llvm/16 doesn't build because of
> > 
> > /usr/bin/ld: unrecognized option '-Bsymbolic-functions'
> > 
> > which due to missing patches for the OPENBSD_LD_IS_LLD hack.
> > 
> > It does seem to work, more or less: I got a working ksh and libcrypto,
> > although I did see a segfault of lld once when building dsa_ameth.c.
> > 
> > 
> > As can be seen in [2], llvm/13 doesn't package because of
> > 
> > Error: 
> > /usr/obj/ports/llvm-13.0.0/fake-sparc64/usr/local/llvm13/lib/clang/13.0.0/include/unwind.h
> >  does not exist
> > 
> > (this also affects llvm/16)
> > 
> > The reason for this is that sparc64 has /usr/include/unwind.h from gcc,
> > so it's removed by the post-install hook in Makefile.inc.
> > 
> > Not sure if exempting unwind.h from removal is the right approach, or
> > if it should be @commented in the PLIST, or if there is another approach
> > for special casing this on sparc64.
> > 
> > The diff below addresses both of these with no package change for other
> > architectures, so no bump. I'm certain about the fix for 16. I leave the
> > fix for unwind.h for others to evaluate.
> > 
> > [1]: 
> > http://build-failures.rhaalovely.net/sparc64/2023-10-08/devel/llvm/16,-lldb.log
> > [2]: 
> > http://build-failures.rhaalovely.net/sparc64/2023-10-08/devel/llvm/13.log
> > 
> > Index: Makefile.inc
> > ===================================================================
> > RCS file: /cvs/ports/devel/llvm/Makefile.inc,v
> > retrieving revision 1.9
> > diff -u -p -r1.9 Makefile.inc
> > --- Makefile.inc    23 Sep 2023 12:31:55 -0000      1.9
> > +++ Makefile.inc    12 Oct 2023 18:45:52 -0000
> > @@ -183,8 +183,9 @@ post-install:
> >     rm -rf ${PREFIX}/${LLVM_BASE}/man    
> >  
> >     # search and remove headers that might conflict with base
> > +   # explicitly leave unwind.h in place for sparc64 (base-gcc)
> >     cd ${PREFIX}/${CLANG_INCLUDE_PATH} && \
> > -           find . -name '*.h' | sed "s,./,,g" | while read h; \
> > +           find . -name '*.h' | fgrep -v './unwind.h' | sed "s,./,,g" | 
> > while read h; \
> >             do \
> >                     if test -e /usr/include/$${h}; then rm $${h}; fi; \
> >             done
> > Index: 16/patches/patch-clang_tools_clang-shlib_CMakeLists_txt
> > ===================================================================
> > RCS file: 16/patches/patch-clang_tools_clang-shlib_CMakeLists_txt
> > diff -N 16/patches/patch-clang_tools_clang-shlib_CMakeLists_txt
> > --- /dev/null       1 Jan 1970 00:00:00 -0000
> > +++ 16/patches/patch-clang_tools_clang-shlib_CMakeLists_txt 12 Oct 2023 
> > 18:45:52 -0000
> > @@ -0,0 +1,13 @@
> > +-Bsymbolic-functions is not supported by our ld.bfd version.
> > +
> > +Index: clang/tools/clang-shlib/CMakeLists.txt
> > +--- clang/tools/clang-shlib/CMakeLists.txt.orig
> > ++++ clang/tools/clang-shlib/CMakeLists.txt
> > +@@ -50,6 +50,6 @@ add_clang_library(clang-cpp
> > +                   ${_DEPS})
> > + # Optimize function calls for default visibility definitions to avoid PLT 
> > and
> > + # reduce dynamic relocations.
> > +-if (NOT APPLE AND NOT MINGW)
> > ++if (NOT APPLE AND NOT MINGW AND ${OPENBSD_LD_IS_LLD})
> > +   target_link_options(clang-cpp PRIVATE LINKER:-Bsymbolic-functions)
> > + endif()
> > Index: 16/patches/patch-llvm_tools_llvm-shlib_CMakeLists_txt
> > ===================================================================
> > RCS file: 16/patches/patch-llvm_tools_llvm-shlib_CMakeLists_txt
> > diff -N 16/patches/patch-llvm_tools_llvm-shlib_CMakeLists_txt
> > --- /dev/null       1 Jan 1970 00:00:00 -0000
> > +++ 16/patches/patch-llvm_tools_llvm-shlib_CMakeLists_txt   12 Oct 2023 
> > 18:45:52 -0000
> > @@ -0,0 +1,14 @@
> > +-Bsymbolic-functions is not supported by our ld.bfd version.
> > +
> > +Index: llvm/tools/llvm-shlib/CMakeLists.txt
> > +--- llvm/tools/llvm-shlib/CMakeLists.txt.orig
> > ++++ llvm/tools/llvm-shlib/CMakeLists.txt
> > +@@ -51,7 +51,7 @@ if(LLVM_BUILD_LLVM_DYLIB)
> > +       # Solaris ld does not accept global: *; so there is no way to 
> > version *all* global symbols
> > +       set(LIB_NAMES 
> > -Wl,--version-script,${LLVM_LIBRARY_DIR}/tools/llvm-shlib/simple_version_script.map
> >  ${LIB_NAMES})
> > +     endif()
> > +-    if (NOT MINGW)
> > ++    if (NOT MINGW AND ${OPENBSD_LD_IS_LLD})
> > +       # Optimize function calls for default visibility definitions to 
> > avoid PLT and
> > +       # reduce dynamic relocations.
> > +       # Note: for -fno-pic default, the address of a function may be 
> > different from
> 
> -- 
> Regards,
> Robert Nagy

Reply via email to