From patchwork Mon Dec 19 16:21:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tristan Gingold X-Patchwork-Id: 132284 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]) by ozlabs.org (Postfix) with SMTP id 569A0B6FED for ; Tue, 20 Dec 2011 03:21:34 +1100 (EST) Received: (qmail 25705 invoked by alias); 19 Dec 2011 16:21:31 -0000 Received: (qmail 25695 invoked by uid 22791); 19 Dec 2011 16:21:30 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL, BAYES_00, SARE_SUB_6CONS_WORD X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 19 Dec 2011 16:21:11 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id F40AE290016; Mon, 19 Dec 2011 17:21:10 +0100 (CET) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WDP8LfcNRXv2; Mon, 19 Dec 2011 17:21:10 +0100 (CET) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id DC1B1290009; Mon, 19 Dec 2011 17:21:10 +0100 (CET) From: Tristan Gingold Subject: [Patch/libiberty] Assume strncmp works in cross compilation Date: Mon, 19 Dec 2011 17:21:09 +0100 Message-Id: <826D248B-5400-4EA6-AA34-48412AA24338@adacore.com> Cc: Ian Lance Taylor To: GCC Patches Mime-Version: 1.0 (Apple Message framework v1251.1) X-IsSubscribed: yes 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 Hi, currently libiberty will compile strncmp while building a cross compiler. This is due to the fact that the test for strncmp is a TRY_RUN test. My issue is that VMS doesn't like a redefinition of a standard function, because it always uses a shared library for C and doesn't support symbol preemption. I'd like to reverse the decision for strncmp in cross-case. I understand that there is no ideal solution as both decision may fail on different setup. But: * according to the comment, the test was made for SunOS4 (at least), which is not anymore supported by gcc * defining a standard ANSI-C function in user code is not valid (as far as I understand from the standard) Ok for trunk ? Tristan. libiberty/ 2011-12-19 Tristan Gingold * aclocal.m4: Assume strncmp works in cross case. * configure: Regenerate. diff --git a/libiberty/aclocal.m4 b/libiberty/aclocal.m4 index a528604..bf8a907 100644 --- a/libiberty/aclocal.m4 +++ b/libiberty/aclocal.m4 @@ -72,7 +72,7 @@ main () exit (0); } ], ac_cv_func_strncmp_works=yes, ac_cv_func_strncmp_works=no, - ac_cv_func_strncmp_works=no) + ac_cv_func_strncmp_works=yes) rm -f core core.* *.core]) if test $ac_cv_func_strncmp_works = no ; then AC_LIBOBJ([strncmp])