On Tue, 7 Jun 2022, Bram Moolenaar wrote:


Hisashi T Fujinaka wrote:

I think this broke my build. Config params are:

./configure --disable-canberra --disable-darwin --enable-cscope 
--enable-gui=gtk2 --enable-multibyte --enable-pythoninterp --enable-terminal

The error I get is in the final linking:

Undefined symbols for architecture x86_64:
   "_timer_create", referenced from:
       _start_timeout in os_unix.o
   "_timer_settime", referenced from:
       _stop_timeout in os_unix.o
       _start_timeout in os_unix.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

What system is this on?

This is on a Mac running Monterrey (or is it Monterey?)

What is the contents of auto/config.h ?
Specifically the value of HAVE_TIMER_CREATE

/* #undef HAVE_TIMER_CREATE */

I now see that in os_unix.c there is this line:

        # if defined(HAVE_TIMER_CREATE) || defined(MACOS_X)

This assumes that any Mac system has timer_create().  Looks like this
isn't true.  Can you change that line to:

        # if defined(HAVE_TIMER_CREATE)

It looks like this is the only line where this matters.

Also, the contents of auto/config.log where it says "checking for timer_create"

configure:13071: checking for timer_create
configure:13098: gcc -o conftest -g -O2 -I/opt/sw/include  -DMACOS_X  conftest.c 
-lncurses  -L/opt/sw/lib -lsodium -lrt >&5
conftest.c:149:34: warning: omitting the parameter name in a function 
definition is a C2x extension [-Wc2x-extensions]
static void set_flag(union sigval) {}
                                  ^
conftest.c:157:3: error: unknown type name 'timer_t'; did you mean 'time_t'?
   timer_t timer_id;
   ^~~~~~~
   time_t
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_time_t.h:31:33:
 note: 'time_t' declared here
typedef __darwin_time_t         time_t;
                                 ^
conftest.c:161:3: error: implicit declaration of function 'timer_create' is invalid in 
C99 [-Werror,-Wimplicit-function-declaration]  timer_create(CLOCK_REALTIME, 
&action, &timer_id);
   ^
1 warning and 2 errors generated.
c

What is the build command used?  Do you overrule $LIBS perhaps?

make

I meant the linker command that gets executed.  But considering the
above, it would not matter.

Changing to:

# if defined(HAVE_TIMER_CREATE)

fixed the build.

--
Hisashi T Fujinaka - [email protected]
BSEE + BSChem + BAEnglish + MSCS + $2.50 = coffee

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/63a8e560-05d0-6a9b-6737-169ffd205673%40twofifty.com.

Raspunde prin e-mail lui