Cant compile with gcc 11.2.1 - on Gentoo
Cross-platform BBS (ANSI) Terminal
Brought to you by:
deuce
here's the error I get a few minutes into compilation:
make[1]: Leaving directory '/home/doc/Downloads/syncterm-20220104/src/hash' Linking gcc.linux.x64.exe.debug/syncterm /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/../../../../x86_64-pc-linux-gnu/bin/ld: /home/doc/Downloads/syncterm-20220104/src/../3rdp/gcc.linux.x64.debug/cl/libcl.a(sendmsg.o): in function `waitForObject': sendmsg.c:(.text+0x10c6): undefined reference to `pthread_yield' collect2: error: ld returned 1 exit status make: *** [GNUmakefile:111: gcc.linux.x64.exe.debug/syncterm] Error 1
Anonymous
Could you rebuild with
VERBOSE=1
passed on the make command-line and provide the ld command used? The manpage for pthread_yield on Gentoo may help as well.pthread_yield() is a terrible non-portable function, but it's always been available on Linux as far as I've seen.
man page for pthread_yield shows this":
VERSIONS
Since glibc 2.34, this function is marked as deprecated.
Full Build Log at https://pastebin.com/V0Pxyqk3
Ah, just realized i could upload attachment
I also have this problem, but I'm using Arch Linux. I'm including my log.
(my man page also says "Since glibc 2.34, this function is marked as deprecated.")
Last edit: chrll 2022-02-26
Also failing on Fedora35
Failing here too, also on Arch.
I believe the problem is that for Linux with GNU, PTHREAD_YIELD is wrongly defined as pthread_yield, but man pthread_yield say it is deprecated, and sched_yield() should be used instead. As explained in the thread.h of cl (cryptlib), sched_yield is the right choice after the standard confusion (two parralel versions, they were unsure which would be standardized).
/syncterm-1.1/3rdp/src/cl/kernel/thread.h:3015 have:
should be #define THREAD_YIELD sched_yield()
I believe some compatibility define has been removed in Ubuntu lately:
https://sourceware.org/git/?p=glibc.git;a=commit;h=c2fd60a5861efef48252f5cc7efc70e1d8a0da9a
and so in Ubuntu 22.04 it does not compile anymore.
That said, I tried to change the file directly, and remove syncterm-1.1-src/syncterm-1.1/3rdp/gcc.linux.x64.debug/cl/libcl.a, but that does not work, because I believe the .zip is redecompress and so a new patch file must be made.
cryptlib 3.4.6 (release candidate) have:
I tried to replace the zip file by the new version but then some patch does not apply anymore.
I was not using git clone https://gitlab.synchro.net/main/sbbs.git
and it seems fixed there (I change hard disk since yesterday, but using Xubuntu 22.04, yesterday Ubuntu 22.04). I looked at the modified thread.h file and it seems ok: