Opened 4 years ago

Last modified 18 months ago

#61486 new defect

fluxbox @1.3.7_1 does not compile on macOS Big Sur, Version 11.0.1, because "src/FbTk/FbTime.cc:64:10: error: redefinition of '_mono'"

Reported by: ballapete (Peter "Pete" Dyballa) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: bigsur Cc:
Port: fluxbox

Description

mv -f src/FbTk/.deps/libFbTk_a-AutoReloadHelper.Tpo src/FbTk/.deps/libFbTk_a-AutoReloadHelper.Po
/usr/bin/clang++ -DHAVE_CONFIG_H -I.  -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include/fribidi -include ./config.h -I./src -I./src -I./nls -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11\
.0.sdk  -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk -arch x86_64  -MT src/FbTk/libFbTk_a-Font.o -MD -MP -MF src/FbTk/.deps/libFbTk_a-Font.Tpo -c -o src/FbTk/libFbTk_a-Font.o `test -f 'src/FbTk/Font.cc' || \
echo './'`src/FbTk/Font.cc
src/FbTk/FbTime.cc:64:10: error: redefinition of '_mono'
uint64_t _mono() {
         ^
src/FbTk/FbTime.cc:33:10: note: previous definition is here
uint64_t _mono() {
         ^
1 error generated.
make[2]: *** [src/FbTk/libFbTk_a-FbTime.o] Error 1
make[2]: *** Waiting for unfinished jobs....
mv -f src/FbTk/.deps/libFbTk_a-Color.Tpo src/FbTk/.deps/libFbTk_a-Color.Po
mv -f src/FbTk/.deps/libFbTk_a-BorderTheme.Tpo src/FbTk/.deps/libFbTk_a-BorderTheme.Po
mv -f src/FbTk/.deps/libFbTk_a-EventManager.Tpo src/FbTk/.deps/libFbTk_a-EventManager.Po
mv -f src/FbTk/.deps/libFbTk_a-Container.Tpo src/FbTk/.deps/libFbTk_a-Container.Po
mv -f src/FbTk/.deps/libFbTk_a-ImageImlib2.Tpo src/FbTk/.deps/libFbTk_a-ImageImlib2.Po
mv -f src/FbTk/.deps/libFbTk_a-App.Tpo src/FbTk/.deps/libFbTk_a-App.Po
mv -f src/FbTk/.deps/libFbTk_a-FbString.Tpo src/FbTk/.deps/libFbTk_a-FbString.Po
mv -f src/FbTk/.deps/libFbTk_a-FbPixmap.Tpo src/FbTk/.deps/libFbTk_a-FbPixmap.Po
mv -f src/FbTk/.deps/libFbTk_a-FbWindow.Tpo src/FbTk/.deps/libFbTk_a-FbWindow.Po
mv -f src/FbTk/.deps/libFbTk_a-FileUtil.Tpo src/FbTk/.deps/libFbTk_a-FileUtil.Po
mv -f src/FbTk/.deps/libFbTk_a-Font.Tpo src/FbTk/.deps/libFbTk_a-Font.Po
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_x11_fluxbox/fluxbox/work/fluxbox-1.3.7'

Attachments (1)

main.log (116.0 KB) - added by ballapete (Peter "Pete" Dyballa) 4 years ago.
Main.log from build on Big Sur

Download all attachments as: .zip

Change History (4)

Changed 4 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: main.log added

Main.log from build on Big Sur

comment:1 Changed 4 years ago by ballapete (Peter "Pete" Dyballa)

src/FbTk/Font.cc has:

   28	#ifdef HAVE_CLOCK_GETTIME // linux|*bsd|solaris
   29	#include <time.h>
   30	
   31	namespace {
   32	
   33	uint64_t _mono() {
   34	
   35	    uint64_t t = 0L;
   36	    timespec ts;
   37	
   38	    if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) {
   39	        t = (ts.tv_sec * FbTk::FbTime::IN_SECONDS) + (ts.tv_nsec / 1000L);
   40	    }
   41	
   42	    return t;
   43	}
   44	
   45	}
   46	
   47	#endif // HAVE_CLOCK_GETTIME
   48	
   49	
   50	
   51	
   52	
   53	#ifdef HAVE_MACH_ABSOLUTE_TIME // macosx
   54	
   55	// http://stackoverflow.com/questions/5167269/clock-gettime-alternative-in-mac-os-x
   56	// https://github.com/ThomasHabets/monotonic_clock/blob/master/src/monotonic_mach.c
   57	// http://shiftedbits.org/2008/10/01/mach_absolute_time-on-the-iphone/
   58	
   59	
   60	#include <mach/mach_time.h>
   61	
   62	namespace {
   63	
   64	uint64_t _mono() {
   65	
   66	    // mach_absolute_time() * info.numer / info.denom yields
   67	    // nanoseconds.
   68	
   69	    static double micro_scale = 0.001;  // 1000ms == 1ns
   70	    static bool initial = true;
   71	
   72	    if (initial) {
   73	        initial = false;
   74	        mach_timebase_info_data_t info;
   75	        if (mach_timebase_info(&info) == 0) {
   76	            micro_scale *= static_cast<double>(info.numer) / static_cast<double>(info.denom);
   77	        }
   78	    }
   79	
   80	    return static_cast<uint64_t>(mach_absolute_time() * micro_scale);
   81	}
   82	
   83	}
   84	
   85	#endif // HAVE_MACH_ABSOLUTE_TIME

config.log has both:

#define HAVE_CLOCK_GETTIME 1
#define HAVE_MACH_ABSOLUTE_TIME 1

or in configure's output:

checking for strftime... yes
checking for clock_gettime... yes
checking for clock_gettime in -lrt... no
checking for mach_absolute_time... yes

clang does

#define __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ 110000

so it's probably best to guard the first or the second function definition with this because presumingly CLOCK_GETTIME or MACH_ABSOLUTE_TIME has been introduced in Big Sur.

comment:3 Changed 18 months ago by ballapete (Peter "Pete" Dyballa)

On macOS Monterey, Version 12.6, fluxbox builds. Since the time of Big Sur is gone for me, the ticket can be closed IMO.

Note: See TracTickets for help on using tickets.