On Fri, Mar 04, 2022 at 10:28:54AM +0000, Klemens Nanni wrote:
> On Thu, Mar 03, 2022 at 12:31:06AM -0500, Kurt Mosiejczuk wrote:
> > snappy 1.1.9 explodes horribly on sparc64:
> > 
> > /usr/obj/ports/snappy-1.1.9/bin/c++ -DHAVE_CONFIG_H -Dsnappy_EXPORTS -I. 
> > -I/usr/obj/ports/snappy-1.1.9/snappy-1.1.9 -O2 -pipe -Wall -Wextra 
> > -fno-exceptions -fno-rtti -DNDEBUG -fPIC -std=c++11 -MD -MT 
> > CMakeFiles/snappy.dir/snappy.cc.o -MF CMakeFiles/snappy.dir/snappy.cc.o.d 
> > -o CMakeFiles/snappy.dir/snappy.cc.o -c 
> > /usr/obj/ports/snappy-1.1.9/snappy-1.1.9/snappy.cc
> > /usr/obj/ports/snappy-1.1.9/snappy-1.1.9/snappy.cc:1017:8: warning: 
> > always_inline function might not be inlinable [-Wattributes]
> >  size_t AdvanceToNextTag(const uint8_t** ip_p, size_t* tag) {
> >         ^~~~~~~~~~~~~~~~
> > /usr/obj/ports/snappy-1.1.9/snappy-1.1.9/snappy.cc: In function 
> > 'std::pair<const unsigned char*, long int> 
> > snappy::DecompressBranchless(const uint8_t*, const uint8_t*, ptrdiff_t, T, 
> > ptrdiff_t) [with T = char*]':
> > /usr/obj/ports/snappy-1.1.9/snappy-1.1.9/snappy.cc:1017:8: error: inlining 
> > failed in call to always_inline 'size_t snappy::AdvanceToNextTag(const 
> > uint8_t**, size_t*)': function body can be overwritten at link time
> > /usr/obj/ports/snappy-1.1.9/snappy-1.1.9/snappy.cc:1097:43: note: called 
> > from here
> >          size_t tag_type = AdvanceToNextTag(&ip, &tag);
> > 
> > ...
> > 
> > There's a bit more.
> > 
> > This patch makes it _not_ set always_inline on sparc64. This fixes the 
> > build.
> 
> No need for a patch, you could pass `-U HAVE_ATTRIBUTE_ALWAYS_INLINE` in
> our Makefile.
> 
> We could also disable the flag that triggers this?

Meh, that only "worked" because my sparc64 tree was still at snappy
1.1.8 which builds anyway...

> > ok?

OK kn for your patch

> > 
> > --Kurt
> > 
> > Index: patches/patch-snappy-stubs-internal_h
> > ===================================================================
> > RCS file: patches/patch-snappy-stubs-internal_h
> > diff -N patches/patch-snappy-stubs-internal_h
> > --- /dev/null       1 Jan 1970 00:00:00 -0000
> > +++ patches/patch-snappy-stubs-internal_h   3 Mar 2022 05:28:19 -0000
> > @@ -0,0 +1,14 @@
> > +Don't set this for sparc64, it keeps it from building
> > +
> > +Index: snappy-stubs-internal.h
> > +--- snappy-stubs-internal.h.orig
> > ++++ snappy-stubs-internal.h
> > +@@ -99,7 +99,7 @@
> > + #endif
> > + 
> > + // Inlining hints.
> > +-#ifdef HAVE_ATTRIBUTE_ALWAYS_INLINE
> > ++#if defined(HAVE_ATTRIBUTE_ALWAYS_INLINE) && !defined(__sparc64__)
> > + #define SNAPPY_ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline))
> > + #else
> > + #define SNAPPY_ATTRIBUTE_ALWAYS_INLINE
> > 
> 

Reply via email to