From 687695ee87e738674204743a3bfc275e0ba6b3d7 Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Fri, 22 Dec 2023 21:05:49 +0100 Subject: [PATCH] Link with lib util (fixes #896) --- native/Makefile | 2 +- native/Makefile.common | 16 ++--- .../jline/nativ/Linux/arm/libjlinenative.so | Bin 20996 -> 21016 bytes .../jline/nativ/Linux/arm64/libjlinenative.so | Bin 14232 -> 14248 bytes .../jline/nativ/Linux/armv7/libjlinenative.so | Bin 13384 -> 13404 bytes .../jline/nativ/Linux/ppc64/libjlinenative.so | Bin 72000 -> 72008 bytes .../jline/nativ/Linux/x86/libjlinenative.so | Bin 16304 -> 16324 bytes .../nativ/Linux/x86_64/libjlinenative.so | Bin 13688 -> 13704 bytes .../impl/jansi/JansiTerminalProviderTest.java | 37 +++++++++++ .../impl/jna/JnaTerminalProviderTest.java | 60 ++++++++++++++++++ .../impl/jni/JniTerminalProviderTest.java | 53 ++++++++++++++++ 11 files changed, 159 insertions(+), 9 deletions(-) create mode 100644 terminal-jna/src/test/java/org/jline/terminal/impl/jna/JnaTerminalProviderTest.java create mode 100644 terminal-jni/src/test/java/org/jline/terminal/impl/jni/JniTerminalProviderTest.java diff --git a/native/Makefile b/native/Makefile index 4b42b1bbc..91595d609 100644 --- a/native/Makefile +++ b/native/Makefile @@ -83,7 +83,7 @@ NATIVE_DLL:=$(NATIVE_DIR)/$(LIBNAME) # For cross-compilation, install docker. See also https://github.com/dockcross/dockcross # Disabled linux-armv6 build because of this issue; https://github.com/dockcross/dockcross/issues/190 native-all: \ - linux-x86 linux-x86_64 linux-arm linux-armv6 linux-armv7 linux-arm64 linux-ppc64 linux-riscv64 \ + linux-x86 linux-x86_64 linux-arm linux-armv6 linux-armv7 linux-arm64 linux-ppc64 \ win-x86 win-x86_64 win-arm64 \ mac-x86 mac-x86_64 mac-arm64 \ freebsd-x86 freebsd-x86_64 diff --git a/native/Makefile.common b/native/Makefile.common index 5e7030575..f9ba200db 100644 --- a/native/Makefile.common +++ b/native/Makefile.common @@ -36,43 +36,43 @@ Default_LIBNAME := libjlinenative.so Linux-x86_CC := $(CROSS_PREFIX)gcc Linux-x86_STRIP := $(CROSS_PREFIX)strip Linux-x86_CCFLAGS := -I$(JAVA_HOME)/include -Itarget/inc -Itarget/inc/unix -Os -fPIC -m32 -fvisibility=hidden -Linux-x86_LINKFLAGS := -shared -static-libgcc +Linux-x86_LINKFLAGS := -shared -static-libgcc -lutil Linux-x86_LIBNAME := libjlinenative.so Linux-x86_64_CC := $(CROSS_PREFIX)gcc Linux-x86_64_STRIP := $(CROSS_PREFIX)strip Linux-x86_64_CCFLAGS := -I$(JAVA_HOME)/include -Itarget/inc -Itarget/inc/unix -Os -fPIC -m64 -fvisibility=hidden -Linux-x86_64_LINKFLAGS := -shared -static-libgcc +Linux-x86_64_LINKFLAGS := -shared -static-libgcc -lutil Linux-x86_64_LIBNAME := libjlinenative.so Linux-arm_CC := $(CROSS_PREFIX)gcc Linux-arm_STRIP := $(CROSS_PREFIX)strip Linux-arm_CCFLAGS := -I$(JAVA_HOME)/include -Itarget/inc -Itarget/inc/unix -Os -fPIC -mfloat-abi=softfp -mfpu=vfp -fvisibility=hidden -Linux-arm_LINKFLAGS := -shared -static-libgcc +Linux-arm_LINKFLAGS := -shared -static-libgcc -lutil Linux-arm_LIBNAME := libjlinenative.so Linux-armv6_CC := $(CROSS_PREFIX)gcc Linux-armv6_STRIP := $(CROSS_PREFIX)strip Linux-armv6_CCFLAGS := -I$(JAVA_HOME)/include -Itarget/inc -Itarget/inc/unix -Os -mfloat-abi=hard -mfpu=vfp -fPIC -fvisibility=hidden -Linux-armv6_LINKFLAGS := -shared -static-libgcc +Linux-armv6_LINKFLAGS := -shared -static-libgcc -lutil Linux-armv6_LIBNAME := libjlinenative.so Linux-armv7_CC := $(CROSS_PREFIX)gcc Linux-armv7_STRIP := $(CROSS_PREFIX)strip Linux-armv7_CCFLAGS := -I$(JAVA_HOME)/include -Itarget/inc -Itarget/inc/unix -Os -mfloat-abi=hard -mfpu=vfp -fPIC -fvisibility=hidden -Linux-armv7_LINKFLAGS := -shared -static-libgcc +Linux-armv7_LINKFLAGS := -shared -static-libgcc -lutil Linux-armv7_LIBNAME := libjlinenative.so Linux-arm64_CC := $(CROSS_PREFIX)gcc Linux-arm64_STRIP := $(CROSS_PREFIX)strip Linux-arm64_CCFLAGS := -I$(JAVA_HOME)/include -Itarget/inc -Itarget/inc/unix -Os -march=armv8-a -fPIC -fvisibility=hidden -Linux-arm64_LINKFLAGS := -shared -static-libgcc +Linux-arm64_LINKFLAGS := -shared -static-libgcc -lutil Linux-arm64_LIBNAME := libjlinenative.so Linux-ppc64_CC := $(CROSS_PREFIX)gcc Linux-ppc64_STRIP := $(CROSS_PREFIX)strip Linux-ppc64_CCFLAGS := -I$(JAVA_HOME)/include -Itarget/inc -Itarget/inc/unix -Os -fPIC -fvisibility=hidden -Linux-ppc64_LINKFLAGS := -shared -static-libgcc +Linux-ppc64_LINKFLAGS := -shared -static-libgcc -lutil Linux-ppc64_LIBNAME := libjlinenative.so Linux-riscv64_CC := $(CROSS_PREFIX)gcc @@ -130,7 +130,7 @@ ifeq ($(wildcard MAC_SDK),) MAC_SDK := /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk endif Mac-x86_64_CCFLAGS := -I$(MAC_SDK)/System/Library/Frameworks/JavaVM.framework/Headers -Itarget/inc -Itarget/inc/unix -Os -fPIC -mmacosx-version-min=10.6 -fvisibility=hidden -Mac-x86_64_LINKFLAGS := -dynamiclib +Mac-x86_64_LINKFLAGS := -dynamiclib Mac-x86_64_LIBNAME := libjlinenative.jnilib Mac-arm64_CC := $(CROSS_PREFIX)clang -v diff --git a/native/src/main/resources/org/jline/nativ/Linux/arm/libjlinenative.so b/native/src/main/resources/org/jline/nativ/Linux/arm/libjlinenative.so index 6791f478d8bae5c470ad5353f7af11e74ad5ad04..bc9415fad1152733122236807fb6c70a31ad46c9 100755 GIT binary patch delta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((`W?pnMhAYr-?5&D(=RB+v z`|1n0XPzz8TlU=(XLU{bGyCe}eBbT*Ylv}gI;qbg#$D%_{w-qcEfe}}#JC!q*LAsi zJ)BGH1G%y|_jPIgXs$lam7p523O$}HOW5N%>_PLFb5%jmqyN-dA6(NxSJnRjqz6dg diff --git a/native/src/main/resources/org/jline/nativ/Linux/arm64/libjlinenative.so b/native/src/main/resources/org/jline/nativ/Linux/arm64/libjlinenative.so index de656faadb5fb4e365e35f3b1040b6cf389c9231..a5953000fa18368a9c7c517d6e2608bde2d63f1c 100755 GIT binary patch delta 2401 zcmbVNeQZ-z6uWCp>MiUpKq$5NI?vE`lipiohnn=lXp4WRX3042`HGSuu z-}$=l-gAEMSmI0~U1#%HNb!ntL9S=o!!gHdu1QGtEU9YV5C)}w_w`jj#=wC_@#Km1gb`rPLW@1HHo6#zz;jQ z|NX-MTL_xn^fGKUYwc;V;z3d8aoi9iX1~BI1pW(TFlH9U&6@70;-Gwwkcf$7=gm`0 zePMX_p#S-VKM3zv#8pQ4Pl0l^=T#$+;_p)ovEs7_|3@=N@URt9uAqXKVgEwd4V~NB zZM*CO#bj6sxhdXvN;H7P$0Y9N?~OPdS9efz_D}UAM#td;i-$(xqUA~236)jhvO^u2 z-gi16v2vsN96nCMhby$u4ar>lDPYpCsw7NTVHcOxuXz-5p9pg2c+=YUnO zWyBAGY9I6X;Sm&3KfF}!D;w}ptc8)nu{*j(F?JzV=c zqi?_gy^jvUv_4_$U0OamuhfjrDH!ibT?%F2UiAl4<%x{J)dqKu=(^&W8s{b3Q#QWn zS|W!>H=OXA1h30Yry%CqLhX=oZLy^)xuu*7l7_r1u&!U_>hkikF$vgj{JJ4^VJ{eZ zCgz44^_$-GIUq_cFy)TKl41b=w}hBy0tvx}6j4U{QED_@)G9~{VyJQYs3b|G5lxp= zD3)0i3hv4hoIqa-OnaU6Rm3W|@lLO5+!g9`DpoRuQlq(|W+yWc^qmftX5NOu42N0b z4v{Qglq!kC)<%skfwwV0cN)*kR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9+J)!HM=9?MaNS;R*Zkmisqa@WEcoQ%o*OfoGh3|0SS&OZTS znpGrx%@iG+2`o%=ikdtH@8#@oAeiQ~@8{gZeAYX-rzi}dr#(C_flJTA*JzW+qgu^9 z?Zf%xkW6wCsLpDSa%no3K8LnU+6z9EHfJjA6I@!uZ98J^x?v4?^nmX#y92~W05!q#&*o2xLCg)N@aL9GBQ^rnecs&=rnhpdgGzvEGXNiGL z$Z4F8+`+j^A>CR;Qdld6ewKQ(it!*yz2;Iz!hS!B5_$_@PnLsbL06W&;4pZaMz3jT-4`cpTcY zOK27B%eFNa%GwpUMWLoN47oY<3yV5z&P)>MlLh~XEHcFc*L23>Hr&Xr_6;YA=O>E? zlLQN-(D?d|jTpmg!6-QL&Im5ThLghkne*wfo`w-vDEQ_bL&40h9Y%x$E4x;YHy5|#QAWc4ZWO@| z!2%x$*-tG)kl352lZ|d;-bJGajD-E}WWD(al%4q3l-P+$m?f6b>o7;O=Z_+LI%324 zIzmmF9pN^3Az6Z!k29lp zIBtP%=OJnX>au3k@$COZ2IRQPKynSy7NBk`jbLxqrjtSNxvh3}Am&DGT7siPJL#=JYKt+=v6CL4w+RK40x;>QUvEbyK(xy z5-ScvUAeHKq+ppvP}DDRt4VHjgY(0jpN_eMIs23EcN5Dc*c_Z6fMN9OhN~q{;&j}l zUb-DxORbbZu=E*SKc;-8*2ha1JXAT2m^4{!YzDE+s<~@{*=1GsC@){~O9lsO=Smvr zF7wh}7$`H($t0;yhI~Bw%vA^9i+VXoLY6>xxs|qoSZ?)gMjZj4GOJuJE>*}@ZhMm3 zHgjp8Z2KPT3(s?%)ThVq$j8${bM0E3DvRI*k6$hE0T?K^`dhg)^+~al^HU!p$B new JansiTerminalProvider().isSystemStream(SystemStream.Output)); + } + + @Test + @Disabled + void testNewTerminal() throws IOException { + PipedOutputStream pos = new PipedOutputStream(); + PipedInputStream pis = new PipedInputStream(pos); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + Terminal terminal = new JansiTerminalProvider() + .newTerminal( + "name", + "xterm", + pis, + baos, + Charset.defaultCharset(), + Terminal.SignalHandler.SIG_DFL, + true, + null, + null); + assertNotNull(terminal); + } } diff --git a/terminal-jna/src/test/java/org/jline/terminal/impl/jna/JnaTerminalProviderTest.java b/terminal-jna/src/test/java/org/jline/terminal/impl/jna/JnaTerminalProviderTest.java new file mode 100644 index 000000000..42363339c --- /dev/null +++ b/terminal-jna/src/test/java/org/jline/terminal/impl/jna/JnaTerminalProviderTest.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2002-2021, the original author(s). + * + * This software is distributable under the BSD license. See the terms of the + * BSD license in the documentation provided with this software. + * + * https://opensource.org/licenses/BSD-3-Clause + */ +package org.jline.terminal.impl.jna; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PipedInputStream; +import java.io.PipedOutputStream; +import java.nio.charset.Charset; + +import org.jline.terminal.Terminal; +import org.jline.terminal.spi.SystemStream; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledOnOs; +import org.junit.jupiter.api.condition.OS; + +import com.sun.jna.Platform; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assumptions.assumeFalse; + +public class JnaTerminalProviderTest { + + @Test + void testIsSystemStream() { + assumeFalse(Platform.isMac() && Platform.is64Bit() && Platform.isARM()); + + assertDoesNotThrow(() -> new JnaTerminalProvider().isSystemStream(SystemStream.Output)); + } + + @Test + @DisabledOnOs(OS.WINDOWS) + void testNewTerminal() throws IOException { + assumeFalse(Platform.isMac() && Platform.is64Bit() && Platform.isARM()); + + PipedOutputStream pos = new PipedOutputStream(); + PipedInputStream pis = new PipedInputStream(pos); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + Terminal terminal = new JnaTerminalProvider() + .newTerminal( + "name", + "xterm", + pis, + baos, + Charset.defaultCharset(), + Terminal.SignalHandler.SIG_DFL, + true, + null, + null); + assertNotNull(terminal); + } +} diff --git a/terminal-jni/src/test/java/org/jline/terminal/impl/jni/JniTerminalProviderTest.java b/terminal-jni/src/test/java/org/jline/terminal/impl/jni/JniTerminalProviderTest.java new file mode 100644 index 000000000..e08a4024b --- /dev/null +++ b/terminal-jni/src/test/java/org/jline/terminal/impl/jni/JniTerminalProviderTest.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2002-2021, the original author(s). + * + * This software is distributable under the BSD license. See the terms of the + * BSD license in the documentation provided with this software. + * + * https://opensource.org/licenses/BSD-3-Clause + */ +package org.jline.terminal.impl.jni; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PipedInputStream; +import java.io.PipedOutputStream; +import java.nio.charset.Charset; + +import org.jline.terminal.Terminal; +import org.jline.terminal.spi.SystemStream; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledOnOs; +import org.junit.jupiter.api.condition.OS; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +public class JniTerminalProviderTest { + + @Test + void testIsSystemStream() { + assertDoesNotThrow(() -> new JniTerminalProvider().isSystemStream(SystemStream.Output)); + } + + @Test + @DisabledOnOs(OS.WINDOWS) + void testNewTerminal() throws IOException { + PipedOutputStream pos = new PipedOutputStream(); + PipedInputStream pis = new PipedInputStream(pos); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + Terminal terminal = new JniTerminalProvider() + .newTerminal( + "name", + "xterm", + pis, + baos, + Charset.defaultCharset(), + Terminal.SignalHandler.SIG_DFL, + true, + null, + null); + assertNotNull(terminal); + } +}