From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 21D9A3858289 for ; Tue, 23 Aug 2022 14:01:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 21D9A3858289 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-378-XJPwKvxbONyonhzOeIpOAA-1; Tue, 23 Aug 2022 10:01:10 -0400 X-MC-Unique: XJPwKvxbONyonhzOeIpOAA-1 Received: by mail-wm1-f72.google.com with SMTP id j22-20020a05600c485600b003a5e4420552so10307615wmo.8 for ; Tue, 23 Aug 2022 07:01:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=W1gI74bv1DHgmfYcK+xag+tsKtfgNgvBzDWYtmut0gY=; b=ELyZC8WjtVos30uta2Cn7mQCHZH09kaXAMKTKCbgap6neQ4h/QLXdoNCrTCV06SAbS Y4u5nH0umg8QtS/ANWN8wvke+w1fXRE8G5sG7fr/knMACn1MeVAf0YszI/E2o0utSPH4 3fCmHQZNlT3apZiQK6QHSE1G/h1f3NyCc7/nTdw5tJ0tNAUdIAbt0wHlsSBES3qKS5r9 uPls7pXDAO6/sTOklEt1aYiOu1j9Qn1J/GoeNGDzYPA4Ct4RezXPnKFSjkCpDfbZnF0r RRkxYx/qNQTfNICqoF0ugewtRt6qXOIyPWyWURIyQki71X/GzXYi12rwsi8NnfKISCIC 1O9Q== X-Gm-Message-State: ACgBeo2XfjXZQJRkrC4ye2HeAJo/BSXuwzbnZIem+vRmam5J810GVncV 7T/NWCgbVt/rwmc7KnS8kP9mGy1+E7j4tQzlUul+qw3ga+a1ZISrKUNZrf/y/62wghYnmv6MRmT 3Ro+EDV81N8GtE3o4aQ== X-Received: by 2002:a05:600c:34d3:b0:3a5:fea5:1be8 with SMTP id d19-20020a05600c34d300b003a5fea51be8mr2305381wmq.106.1661263268444; Tue, 23 Aug 2022 07:01:08 -0700 (PDT) X-Google-Smtp-Source: AA6agR4oJryYiiNYpZEqr0iv9ptCpUEw80LvW4s8gi2+DH7jOLC61Iyd8vfU7BU2GDbfRy6qP6OCUA== X-Received: by 2002:a05:600c:34d3:b0:3a5:fea5:1be8 with SMTP id d19-20020a05600c34d300b003a5fea51be8mr2305366wmq.106.1661263268247; Tue, 23 Aug 2022 07:01:08 -0700 (PDT) Received: from [192.168.1.6] (adsl-2-solo-236-177.claranet.co.uk. [80.168.236.177]) by smtp.gmail.com with ESMTPSA id p16-20020a05600c1d9000b003a5fcae64d4sm18684980wms.29.2022.08.23.07.01.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Aug 2022 07:01:07 -0700 (PDT) Message-ID: Date: Tue, 23 Aug 2022 15:01:06 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH v2] ld: Make library member file suffix comparisons case insensitive when cross compiling too To: =?UTF-8?Q?Martin_Storsj=c3=b6?= , binutils@sourceware.org References: <20220823130606.1659316-1-martin@martin.st> From: Nick Clifton In-Reply-To: <20220823130606.1659316-1-martin@martin.st> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-GB Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2022 14:01:17 -0000 Hi Martin, > +/* Hardcoded case insensitive comparison. filename_cmp is insensitive > + * when running on Windows, but when cross compiling to Windows, we > + * also want similar comparisons to be case insensitive. */ > +static int stricmp (const char *s1, const char *s2) > +{ > + for (;;) > + { > + int c1 = TOLOWER (*s1++); > + int c2 = TOLOWER (*s2++); > + > + if (c1 != c2) > + return (c1 - c2); > + > + if (c1 == '\0') > + return 0; > + } > +} The implementation of filename_cmp() in libiberty also treats forward slashes and backward slashes as the same, on DOS based filesystems. Shouldn't this be carried over to stricmp() as well ? Cheers Nick