termux-packages/packages/heyu/tty_aux.c.patch
Henrik Grimler fd0015b9dd heyu: fix errors about duplicate symbols with ndk >=r22
Errors looks like:

    aarch64-linux-android-clang  -fstack-protector-strong -Oz -Drindex=strrchr  -L/data/data/com.termux/files/usr/lib -Wl,-rpath=/data/data/com.termux/files/usr/lib -fopenmp -static-openmp -Wl,--enable-new-dtags -Wl,--as-needed -Wl,-z,relro,-z,now -o heyu date.o erase.o info.o message.o relay.o monitor.o reset.o setclock.o stop.o tty.o x10.o xread.o xwrite.o status.o cm11a.o eeprom.o process.o sun.o cmd.o config.o x10state.o poll.o modules.o cm17a.o xsync.o timing.o cm10a.o tty_aux.o relay_aux.o x10aux.o rfxcom.o digimax.o oregon.o  -lm
    ld: error: duplicate symbol: newsb
    >>> defined at tty.c
    >>>            tty.o:(newsb)
    >>> defined at tty_aux.c
    >>>            tty_aux.o:(.bss+0x30)

    ld: error: duplicate symbol: oldsb
    >>> defined at tty.c
    >>>            tty.o:(oldsb)
    >>> defined at tty_aux.c
    >>>            tty_aux.o:(.bss+0x0)

    ld: error: duplicate symbol: spoolfile
    >>> defined at relay.c
    >>>            relay.o:(spoolfile)
    >>> defined at relay_aux.c
    >>>            relay_aux.o:(.bss+0x1C4)
    clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
    make[1]: *** [Makefile:467: heyu] Error 1
2021-10-22 23:05:45 +02:00

30 lines
745 B
Diff

--- ../tty_aux.c.orig 2021-09-22 11:12:35.845952747 +0200
+++ ./tty_aux.c 2021-09-22 11:13:47.397197243 +0200
@@ -121,7 +121,7 @@
#if !defined(HAVE_STRUCT_TERMIOS) && !defined(HAVE_STRUCT_TERMIO)
# include <sgtty.h>
-struct sgttyb oldsb, newsb;
+extern struct sgttyb oldsb, newsb;
void hangup();
#else
# ifndef HAVE_STRUCT_TERMIOS
@@ -131,7 +131,7 @@
# ifdef HAVE_SYS_TERMIO_H
# include <sys/termio.h>
# endif
-struct termio oldsb, newsb;
+extern struct termio oldsb, newsb;
# else
# ifdef HAVE_TERMIOS_H
# include <termios.h>
@@ -139,7 +139,7 @@
# ifdef HAVE_SYS_TERMIOS_H
# include <sys/termios.h>
# endif
-struct termios oldsb, newsb;
+extern struct termios oldsb, newsb;
# endif
# ifndef NCC
# define NCC NCCS