From: Uwe K. <Uwe...@gm...> - 2021-03-31 18:08:53
|
Hello Tcl’ers I have tried to build tcl/tk 8.7a3 from the command line (doesn’t build out-of-the-box from .xcodeproj at all) I put both tcl8.7a3 and tk8.7a3 in a common subdir tcltk8.7a3 and renamed both source trees to tcl and tk, respectively tcl builds OK with: cd tcl/macosx ./configure make tk compiles OK with the corresponding command sequence but fails to link: Undefined symbols for architecture x86_64: "_TclIsSpaceProc", referenced from: _strtoul in libtclstub8.7.a(strtoul.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) I understand why this happens (and I worked around it by hacking the compat/strtoul.c to not include a reference to TclIsSpaceProc. But that’s just a hack. I wondered why compat/strtoul.c was included in the build in the first place and I checked config.log. I found that the test for a useable strtoul routine failed abnormally (due to a missing prototype for the exit() function). Similar things happen in several places across the configure process, making the result unrelieable. Any ideas what might have gone wrong? The configure script should have activated the _ISOC99_SOURCE flag which would have pulled in stdlib.h, shouldn’t it? BTW, the same happens when I try to build tcl/tk 8.6.10 from the command line. Best regards, Uwe Here is the snippet from config.log: configure:8841: checking proper strtoul implementation configure:8857: gcc -o conftest -pipe -headerpad_max_install_names -Wl,-search_paths_first conftest.c -lz -lpthread -framework CoreFoundation >&5 conftest.c:72:16: warning: incompatible redeclaration of library function 'strtoul' [-Wincompatible-library-redeclaration] extern int strtoul(); ^ conftest.c:72:16: note: 'strtoul' is a builtin with type 'unsigned long (const char *, char **, int)' conftest.c:74:5: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration] exit(strtoul(string,&term,0) != 0 || term != string+1); ^ conftest.c:74:5: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit' 1 warning and 1 error generated. configure:8857: $? = 1 configure: program exited with status 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "tcl" | #define PACKAGE_TARNAME "tcl" | #define PACKAGE_VERSION "8.7" | #define PACKAGE_STRING "tcl 8.7" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_STDBOOL_H 1 | #define HAVE_SYS_PARAM_H 1 | #define TCL_CFGVAL_ENCODING "iso8859-1" | #define _REENTRANT 1 | #define _THREAD_SAFE 1 | #define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 | #define HAVE_PTHREAD_ATFORK 1 | #define HAVE_DECL_PTHREAD_MUTEX_RECURSIVE 1 | #define HAVE_ZLIB 1 | #define MODULE_SCOPE extern __attribute__((__visibility__("hidden"))) | #define HAVE_HIDDEN 1 | #define MAC_OSX_TCL 1 | #define HAVE_COREFOUNDATION 1 | #define HAVE_CAST_TO_UNION 1 | #define TCL_SHLIB_EXT ".dylib" | #define MP_PREC 4 | #define MP_32BIT 1 | #define TCL_WIDE_INT_IS_LONG 1 | #define HAVE_GETCWD 1 | #define HAVE_MKSTEMP 1 | #define HAVE_OPENDIR 1 | #define HAVE_STRTOL 1 | #define HAVE_WAITPID 1 | #define HAVE_GETNAMEINFO 1 | #define HAVE_GETADDRINFO 1 | #define HAVE_FREEADDRINFO 1 | #define HAVE_GAI_STRERROR 1 | #define HAVE_STRUCT_ADDRINFO 1 | #define HAVE_STRUCT_IN6_ADDR 1 | #define HAVE_STRUCT_SOCKADDR_IN6 1 | #define HAVE_STRUCT_SOCKADDR_STORAGE 1 | #define HAVE_GETPWUID_R_5 1 | #define HAVE_GETPWUID_R 1 | #define HAVE_GETPWNAM_R_5 1 | #define HAVE_GETPWNAM_R 1 | #define HAVE_GETGRGID_R_5 1 | #define HAVE_GETGRGID_R 1 | #define HAVE_GETGRNAM_R_5 1 | #define HAVE_GETGRNAM_R 1 | #define HAVE_MTSAFE_GETHOSTBYNAME 1 | #define HAVE_MTSAFE_GETHOSTBYADDR 1 | #define HAVE_TERMIOS_H 1 | #define HAVE_SYS_IOCTL_H 1 | #define HAVE_SYS_TIME_H 1 | #define TIME_WITH_SYS_TIME 1 | #define HAVE_GMTIME_R 1 | #define HAVE_LOCALTIME_R 1 | #define HAVE_MKTIME 1 | #define HAVE_TM_GMTOFF 1 | #define HAVE_STRUCT_STAT_ST_BLOCKS 1 | #define HAVE_STRUCT_STAT_ST_BLKSIZE 1 | #define HAVE_BLKCNT_T 1 | /* end confdefs.h. */ | int main() { | extern int strtoul(); | char *term, *string = "0"; | exit(strtoul(string,&term,0) != 0 || term != string+1); | } configure:8867: result: broken |