From patchwork Fri Oct 23 03:56:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 534732 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 98F82141314 for ; Fri, 23 Oct 2015 14:56:43 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=a5LhIRfq; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=IudNC7wMwENegLWR 7YwQ8LB0xDt4uifIN5iCPyJwnM0XryXJO/C4xWDIkNGDbmiZ+nnsuahxJFhNUce1 w26JLP32keREXHo4ErNGnC+ypGxp6POFbN6TKEjlJOdVW8OwEatWTD5hpQG1BNYJ xpQdoVmnMjjDg5OfW2C9iqk0Y9I= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=T1crWHL3D+3El5+WeyRYjH QniaM=; b=a5LhIRfq4C7Jq+x+UwvB4i1qTYHUOUd8SdKpF8CdGXNYl5sYc/oymg eRQfRXGG9u73NlU0D3OPdq1PZ+yElnnlp++G5ViLs8mw5hklx1D048asUrl7h9qS TAH7fJs4b27/s7RXXfyPTU0euLdbnfkMGZQeaRI9CkGGTSn1coF1w= Received: (qmail 126161 invoked by alias); 23 Oct 2015 03:56:36 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 126152 invoked by uid 89); 23 Oct 2015 03:56:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: smtp.gentoo.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 23 Oct 2015 03:56:33 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 13160340B1C; Fri, 23 Oct 2015 03:56:30 +0000 (UTC) From: Mike Frysinger To: gcc-patches@gcc.gnu.org Cc: doko@ubuntu.com, per@bothner.com, aph@redhat.com, tromey@redhat.com Subject: [PATCH] libjava: fix locale handling when sorting JNI methods Date: Thu, 22 Oct 2015 23:56:28 -0400 Message-Id: <1445572588-7949-1-git-send-email-vapier@gentoo.org> MIME-Version: 1.0 When building under LANG=cs_CZ.UTF-8, the JNI method check fails: /bin/bash ../../scripts/check_jni_methods.sh Found a problem with the JNI methods declared and implemented. (<) missing in implementation, (>) missing in header files > Java_gnu_java_awt_peer_gtk_GtkClipboard_advertiseContent > Java_gnu_java_awt_peer_gtk_GtkClipboard_initNativeState ... lots more ... While the sed commands are run under LC_ALL=C, the two sort commands are not, and they end up producing unexpected output (for the test). Once we run both under LC_ALL=C, the check passes. While we're here, we can also combine latter the `sort|uniq` into `sort -u` to match the earlier code. URL: https://bugs.gentoo.org/563710 Reported-by: Miroslav Ć ulc 2015-10-22 Mike Frysinger * scripts/check_jni_methods.sh.in: Run sort with LC_ALL=C, and combine `sort|uniq` into `sort -u`. --- libjava/classpath/scripts/check_jni_methods.sh.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libjava/classpath/scripts/check_jni_methods.sh.in b/libjava/classpath/scripts/check_jni_methods.sh.in index facf34b..18834f2 100644 --- a/libjava/classpath/scripts/check_jni_methods.sh.in +++ b/libjava/classpath/scripts/check_jni_methods.sh.in @@ -14,7 +14,7 @@ grep -h '^JNIEXPORT .* Java_' @abs_top_srcdir@/include/*.h | \ LC_ALL=C sed -e 's,.*JNICALL \(Java_[a-z_A-Z0-9]*\).*$,\1,' > $TMPFILE grep -h '^JNIEXPORT .* Java_' @abs_top_builddir@/include/*.h | \ LC_ALL=C sed -e 's,.*JNICALL \(Java_[a-z_A-Z0-9]*\).*$,\1,' >> $TMPFILE -sort -u $TMPFILE > $TMPFILE4 +LC_ALL=C sort -u $TMPFILE > $TMPFILE4 mv $TMPFILE4 $TMPFILE # Find all methods in the JNI C source files. @@ -31,7 +31,7 @@ find @abs_top_srcdir@/native/jni -name \*.cpp | \ cut -f4 -d\ | \ LC_ALL=C sed -e 's,^\JNIEXPORT .* JNICALL \(Java_[a-z_A-Z0-9]*\).*$,\1,' >> $TMPFILE2 mv $TMPFILE2 $TMPFILE3 -sort $TMPFILE3 | uniq > $TMPFILE2 +LC_ALL=C sort $TMPFILE3 > $TMPFILE2 rm $TMPFILE3 # Write temporary ignore file.