On Sat, Dec 18, 2021 at 04:13:04PM +0300, Andrew Krasavin wrote:
> On Sat, Dec 18, 2021 at 12:11:31PM +0100, Omar Polo wrote:
> > Andrew Krasavin <[email protected]> writes:
> >
> > > On Sat, Dec 18, 2021 at 08:51:23AM +0300, Andrew Krasavin wrote:
> > > > Hello.
> > > >
> > > > This port is required for upcoming telegram-desktop port, that we
> > > > are currently working on with Klemens Nanni.
> > > >
> > > > Some things that still need to be done here:
> > > >
> > > > * there are problems with the macppc build
> > > > * the tests are currently turned off
> > > >
> > > > Otherwise it is a working port.
> > > >
> > > > To successfully build a port, you must also apply this patch:
> > > >
> > > > Index: sys/sys/exec_elf.h
> > > > ===================================================================
> > > > RCS file: /cvs/src/sys/sys/exec_elf.h,v
> > > > retrieving revision 1.93
> > > > diff -u -p -r1.93 exec_elf.h
> > > > --- sys/sys/exec_elf.h 7 Dec 2021 22:17:03 -0000 1.93
> > > > +++ sys/sys/exec_elf.h 17 Dec 2021 12:36:39 -0000
> > > > @@ -725,6 +725,7 @@ struct elf_args {
> > > > #define CONCAT(x,y) __CONCAT(x,y)
> > > > #define ELFNAME(x) CONCAT(elf,CONCAT(ELFSIZE,CONCAT(_,x)))
> > > > #define ELFDEFNNAME(x) CONCAT(ELF,CONCAT(ELFSIZE,CONCAT(_,x)))
> > > > +#define ElfW(x) CONCAT(Elf,CONCAT(ELFSIZE,CONCAT(_,x)))
> > > > #endif
> > > > #if defined(ELFSIZE) && (ELFSIZE == 32)
> > > >
> > > > (Klemens has already sent the patch to tech@)
> > > >
> > > > I'll maintain the package.
> > > >
> > > > ---
> > > > Information for inst:abseil-cpp-20211102.0
> > > >
> > > > Comment:
> > > > abseil common libraries (c++)
> > > >
> > > > Description:
> > > > Abseil is an open source collection of C++ libraries drawn from the
> > > > most fundamental pieces of Google's internal codebase. These
> > > > libraries are the nuts-and-bolts that underpin almost everything
> > > > Google runs. Bits and pieces of these APIs are embedded in most
> > > > of our open source projects, and Abseil aims to bring them together
> > > > into one comprehensive project. Abseil encompasses the most basic
> > > > building blocks of Google's codebase: code that is production-tested
> > > > and will be fully maintained for years to come.
> > > >
> > > > Maintainer: Andrew Krasavin <[email protected]>
> > > >
> > > > WWW: https://abseil.io/
> > > > ---
> > > >
> > > > Feedback? OK?
> > > >
> > > > -- Wbr, Andrew Krasavin
> > >
> > > Update:
> > >
> > > Thanks to gkoehler@ kindly agreeing to test my port on macpp and
> > > powerpc, build for those platforms was fixed.
> > >
> > > For this, the patch patch-absl_base_internal_unscaledcycleclock_h
> > > was added (author - George Koehler - gkoehler@) and the patch
> > > patch-absl_debugging_internal_self_mem_image_h was edited
> > > (building vdso-related code is now simply disabled).
> > >
> > > Patch for sys/sys/exec_self.h that I mentioned in the last post is
> > > now also not necessary for a successful compilation.
> > >
> > > Once again I would like to thank George Koehler for his help.
> > >
> > > Updated port is in the attachment. Any feedback would be welcome.
> >
> > the port looks fine, and I'm interested in seeing telegram desktop
> > packaged too.
> >
> > I tried to enable the tests, but it's not easy. It needs a newer
> > version of devel/gtest (or rather, the latest commit or so, upstream
> > stopped tagging versions), then a tweak to disable lsan and even then it
> > fails a linking some tests
> >
> > ld: error: undefined symbol:
> > testing::Matcher<std::__1::basic_string_view<char,
> > std::__1::char_traits<char> > const&>::Matcher(char const*)
> >
> > so I'd add NO_TEST=Yes with a comment and forget about it :)
> >
> > Cheers,
> >
> > Omar Polo
> >
>
> Thanks for the feedback, Omar!
>
> I added NO_TEST=yes to the Makefile, updated archive with the
> port is in the attachment.
I think that's fine in the beginning. For anyone who's interested,
here is the build failure that occurs when removing the following patch:
$OpenBSD$
Avoid _XOPEN_SOURCE as it breaks build of time_zone_format.cc.
Index: absl/time/internal/cctz/src/time_zone_format.cc
--- absl/time/internal/cctz/src/time_zone_format.cc.orig
+++ absl/time/internal/cctz/src/time_zone_format.cc
@@ -18,12 +18,6 @@
#endif
#endif
-#if defined(HAS_STRPTIME) && HAS_STRPTIME
-#if !defined(_XOPEN_SOURCE)
-#define _XOPEN_SOURCE // Definedness suffices for strptime.
-#endif
-#endif
-
#include "absl/base/config.h"
#include "absl/time/internal/cctz/include/cctz/time_zone.h"
It doesn't seem like the right fix, maybe someone else knows better?
---
FAILED:
absl/time/CMakeFiles/time_zone.dir/internal/cctz/src/time_zone_format.cc.o
/usr/ports/pobj/abseil-cpp-20211102.0/bin/c++ -Dtime_zone_EXPORTS
-I/usr/ports/pobj/abseil-cpp-20211102.0/abseil-cpp-20211102.0 -O2 -pipe
-DNDEBUG -fPIC -Wall -Wextra -Wcast-qual -Wconversion
-Wfloat-overflow-conversion -Wfloat-zero-conversion -Wfor-loop-analysis
-Wformat-security -Wgnu-redeclared-enum -Winfinite-recursion
-Winvalid-constexpr -Wliteral-conversion -Wmissing-declarations
-Woverlength-strings -Wpointer-arith -Wself-assign -Wshadow-all
-Wstring-conversion -Wtautological-overlap-compare -Wundef -Wuninitialized
-Wunreachable-code -Wunused-comparison -Wunused-local-typedefs -Wunused-result
-Wvla -Wwrite-strings -Wno-float-conversion -Wno-implicit-float-conversion
-Wno-implicit-int-float-conversion -Wno-implicit-int-conversion
-Wno-shorten-64-to-32 -Wno-sign-conversion -Wno-unknown-warning-option
-DNOMINMAX -std=gnu++17 -MD -MT
absl/time/CMakeFiles/time_zone.dir/internal/cctz/src/time_zone_format.cc.o -MF
absl/time/CMakeFiles/time_zone.dir/internal/cctz/src/time_zone_format.cc.o.d -o
absl/time/CMakeFiles/time_zone.dir/internal/cctz/src/time_zone_format.cc.o -c
/usr/ports/pobj/abseil-cpp-20211102.0/abseil-cpp-20211102.0/absl/time/internal/cctz/src/time_zone_format.cc
In file included from
/usr/ports/pobj/abseil-cpp-20211102.0/abseil-cpp-20211102.0/absl/time/internal/cctz/src/time_zone_format.cc:28:
In file included from
/usr/ports/pobj/abseil-cpp-20211102.0/abseil-cpp-20211102.0/absl/time/internal/cctz/include/cctz/time_zone.h:30:
In file included from
/usr/ports/pobj/abseil-cpp-20211102.0/abseil-cpp-20211102.0/absl/time/internal/cctz/include/cctz/civil_time.h:19:
In file included from
/usr/ports/pobj/abseil-cpp-20211102.0/abseil-cpp-20211102.0/absl/time/internal/cctz/include/cctz/civil_time_detail.h:20:
In file included from /usr/include/c++/v1/ostream:140:
In file included from /usr/include/c++/v1/locale:218:
/usr/include/c++/v1/__bsd_locale_fallbacks.h:122:17: error: use of undeclared
identifier 'vasprintf'; did you mean 'vsprintf'?
int __res = vasprintf(__s, __format, __va);
^
/usr/include/c++/v1/cstdio:124:9: note: 'vsprintf' declared here
using ::vsprintf _LIBCPP_USING_IF_EXISTS;
^
In file included from
/usr/ports/pobj/abseil-cpp-20211102.0/abseil-cpp-20211102.0/absl/time/internal/cctz/src/time_zone_format.cc:28:
In file included from
/usr/ports/pobj/abseil-cpp-20211102.0/abseil-cpp-20211102.0/absl/time/internal/cctz/include/cctz/time_zone.h:30:
In file included from
/usr/ports/pobj/abseil-cpp-20211102.0/abseil-cpp-20211102.0/absl/time/internal/cctz/include/cctz/civil_time.h:19:
In file included from
/usr/ports/pobj/abseil-cpp-20211102.0/abseil-cpp-20211102.0/absl/time/internal/cctz/include/cctz/civil_time_detail.h:20:
In file included from /usr/include/c++/v1/ostream:140:
In file included from /usr/include/c++/v1/locale:218:
/usr/include/c++/v1/__bsd_locale_fallbacks.h:122:27: error: cannot initialize a
parameter of type 'char *' with an lvalue of type 'char **'
int __res = vasprintf(__s, __format, __va);
^~~
/usr/include/stdio.h:269:21: note: passing argument to parameter here
int vsprintf(char *, const char *, __va_list);
^
/usr/ports/pobj/abseil-cpp-20211102.0/abseil-cpp-20211102.0/absl/time/internal/cctz/src/time_zone_format.cc:651:10:
error: use of undeclared identifier 'strptime'
dp = strptime(dp, fmt, tm);
^
3 errors generated.
---
FWIW, this happens on amd64 with bloth clang 11.1.0 and clang 13.0.0
as base compiler.