From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id pLjaIYb0Gmmz5gsAWB0awg (envelope-from ) for ; Mon, 17 Nov 2025 05:10:14 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=XntRY1CT; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 799381E0AB; Mon, 17 Nov 2025 05:10:14 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 2E3F81E08D for ; Mon, 17 Nov 2025 05:10:13 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5A50F3858C31 for ; Mon, 17 Nov 2025 10:10:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5A50F3858C31 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=XntRY1CT Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by sourceware.org (Postfix) with ESMTPS id ECB8B3858D20 for ; Mon, 17 Nov 2025 10:09:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ECB8B3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org ECB8B3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::533 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1763374174; cv=none; b=E5ZlUgYWDO6axtMVHqsF+S7IaZlk6MP2mCGJJ+cvpouzpEpAKT4ye+++VssRSSuqL2VtI/cr5DJPd928k4P68nhZ3WqWPX5X+FdOZq4g5OIawOAVBVH6kYnRfxQKVHBwyh4p1noGF6Uy5EQqwBiG2wbS/WhZvEGZkqs/Wtvyawg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1763374174; c=relaxed/simple; bh=q2HYaPQ8vW2hyIomy1Ln/dI4b+RAjjyVabCDPZZsgcc=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=anpXnhzvZRmZtRktObHG2lr7VK2u9ZlXgDEdnPL+DdODPxvVx9DOueuVStmncvivuzvM30KwBK9WIfanfc9UPdmxHmtAhoUW3MsjZFXyOLdSuPOAogTI34FSo96CJDSz1zEOMkwiwjbO4OLySJ7YeryqoAVt+U8OHfZufMLlSj0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ECB8B3858D20 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-64165cd689eso8008253a12.0 for ; Mon, 17 Nov 2025 02:09:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763374173; x=1763978973; darn=sourceware.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=mYpn76N4UTLaEqlakXqHWKjUM2rEbs7ZJY0F3FNF/lM=; b=XntRY1CTJ9YZaFwcu8KkjEKeWJxkgJT1VzANr1Lzcjkz49hnHUFDJU1IrKwuPhiYis A9r7ykS9AZu9hw9rbh6a6lGCY0xiclp42voyaJgynmZJK6QiAq/krXpwpNvmUAlOfbNW uYnGElmH8y1R2PE95oHWfIo2gFT7WI3ynZefdLpkDp0QBtsrAmrOYm4dZJ0uRv1VPVz5 l5sXdfQl/oY7NMLGJ0NAUfmhK4WCAmhshGYtpoV1NX4NhnHbNCz4h7Au6gA+Ce2XC5SJ btOFRsRbQr9YOYypMpiw3bApbeVehPyMk6TrJkw6IOsDPnK4qsjRsdysmADT7viraCkS yXzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763374173; x=1763978973; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=mYpn76N4UTLaEqlakXqHWKjUM2rEbs7ZJY0F3FNF/lM=; b=Itq+CL9J9sJNvdPHtyq8+GV1lL4iuAUz5AmcYx3zOa5Sy6LTA5SQoapoaL5Mufbth6 qi2Txdsh4oq0fHtKRL/B5FERmdSAdpuqLzWC8BF2Ze5w/abALes+jnK0ElbPmFhTI9rl JkHKpxsuxAGQk5nziU189TXVY0yS3dUWcUNTNLE6nrJofnqHhoFD3iCz4kiWZxEwr+wr p64oO9SbxURS3e41QbByKgInFzf6j35neFq0zmH6BjwyJuS1AZQu4xIKVbxbyG7WI8ev tSqHQicF5vWchyzfMXs9QyoblAgRnIrTX8KyGmLrwvIhX0pha/cOwxnbtRwsBkwiGuL/ Vusg== X-Gm-Message-State: AOJu0Yx7FLJD6Sn7XOsoGYWk7fizASSR5eCQFfWuFsZcG6g3pPQ1xdkN z/2I1zC9EMAZwx57RlkJ5vMMJiuV5wxXTXS+7r2KCl2d6lYEOrbhSWao3iYkvsrcypN85mW0Cvx EA2skCYk3xGHRlbUKYU9P8M9GtgEjYdTis84Q X-Gm-Gg: ASbGnctaWykSfb4eWNt1xpqYcxsPjH5C8/D4+OVIRWbgXZEt6cU9OBo7TPZNgeaDVj8 JgA4NYOXni/bJ9I0lT9SBsbGCHQ2D6Jt+DJn7vbf4K4xqEUNxAOS0bQ9B8few5CQm7p3d3jZPMn cMgv9ergYg8kAUfUmph42+knlfDU6of23madA4/jR/oVTdgZw802JWCO0O9jKq31ix2Az0Kehm2 7jEr3rtRdgLNBMYaOmJGWMRhEj/inTjQMLJH0zoSnPJK4HKziUidcjadHAh0dX5Vi1xZfgVI2q6 fyButgm1CKl+On8B5qMqTtBQZHOkf3MbxMO4QY5Ue6iIz5mbWL3LkmPy1DJ7s16BODeJ39wPonv pqpJgpHQ7y4Mna4+yjLlvkVnYWPAJcSR/1fVlQN9LHXLLNrAY3A== X-Google-Smtp-Source: AGHT+IGDPIlZs+3YERzFaAkoTRKndppdpqa3OSp0VP+uWBlvJRwWSiM35RwOOjeGszsFg3UAuELiYlNj9YGAyQHXnts= X-Received: by 2002:a17:907:724e:b0:b72:8e31:4327 with SMTP id a640c23a62f3a-b7365afa557mr983628166b.25.1763374172334; Mon, 17 Nov 2025 02:09:32 -0800 (PST) MIME-Version: 1.0 References: <20251117012752.2657208-1-tom@tromey.com> <20251117012752.2657208-3-tom@tromey.com> In-Reply-To: <20251117012752.2657208-3-tom@tromey.com> From: Matt Rice Date: Mon, 17 Nov 2025 10:09:19 +0000 X-Gm-Features: AWmQ_bnanhwNSW--0FTNfqFU2HfL8sp3NaBJ7WUVeTpANTEuyyLOsRd0ZbMiCgo Message-ID: Subject: Re: [PATCH 2/7] Make the gdb.objc tests compile To: Tom Tromey Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On Mon, Nov 17, 2025 at 1:33=E2=80=AFAM Tom Tromey wrote: > > The gdb.objc tests haven't compiled in years. This patch fixes this, > based on a comment in bug 31671. > > I don't know whether this approach works with the clang implementation > of Objective-C. However, it does work with GCC, provided that > gnustep-base is installed. I guess at the time all this stuff broke I never felt that was an option (and still feel it is terrible, yet better than the status quo)... Since it is likely *most* people running the testsuite won't have gnustep-b= ase installed, nor all its shell script environment variables since it tends to install its header files in weird locations. I don't see all those -I and -L flags though, so this seems likely it depends upon a certain installation/configuration of gnustep-base which installs stuff in places the compiler will pick them up (likely a distro's specific configuration which isn't the default to conform to distribution specific installation rules) But this breakage all happened before the build bots, likely we can now have an appropriately configured build bot which will notice all the breakages that are likely to occur by people running the testsuite without it installed, so perhaps it is a more viable approach now than I imagined it would be then. > --- > gdb/testsuite/gdb.objc/basicclass.m | 6 +++--- > gdb/testsuite/gdb.objc/nondebug.m | 6 +++--- > gdb/testsuite/gdb.objc/objcdecode.m | 6 +++--- > gdb/testsuite/lib/gdb.exp | 10 +++------- > 4 files changed, 12 insertions(+), 16 deletions(-) > > diff --git a/gdb/testsuite/gdb.objc/basicclass.m b/gdb/testsuite/gdb.objc= /basicclass.m > index d9b3f23954c..d1d54dfff19 100644 > --- a/gdb/testsuite/gdb.objc/basicclass.m > +++ b/gdb/testsuite/gdb.objc/basicclass.m > @@ -1,7 +1,7 @@ > #include > -#include > +#include > > -@interface BasicClass: Object > +@interface BasicClass: NSObject > { > id object; > } > @@ -75,7 +75,7 @@ const char *_NSPrintForDebugger(id object) > { > /* This is not really what _NSPrintForDebugger should do, but it > is a simple test if gdb can call this function */ > - if (object && [object respondsTo: @selector(myDescription)]) > + if (object) > return [object myDescription]; > > return NULL; > diff --git a/gdb/testsuite/gdb.objc/nondebug.m b/gdb/testsuite/gdb.objc/n= ondebug.m > index 352a71c30e3..1ab876443a4 100644 > --- a/gdb/testsuite/gdb.objc/nondebug.m > +++ b/gdb/testsuite/gdb.objc/nondebug.m > @@ -1,11 +1,11 @@ > #include > -#include > +#include > > -@interface NonDebug: Object > +@interface NonDebug: NSObject > { > } > @end > -@interface NonDebug2: Object > +@interface NonDebug2: NSObject > { > } > @end > diff --git a/gdb/testsuite/gdb.objc/objcdecode.m b/gdb/testsuite/gdb.objc= /objcdecode.m > index a061661ed93..78ff301f3e0 100644 > --- a/gdb/testsuite/gdb.objc/objcdecode.m > +++ b/gdb/testsuite/gdb.objc/objcdecode.m > @@ -1,7 +1,7 @@ > #include > -#include > +#include > > -@interface Decode: Object > +@interface Decode: NSObject > { > } > - multipleDef; > @@ -43,7 +43,7 @@ const char *_NSPrintForDebugger(id object) > { > /* This is not really what _NSPrintForDebugger should do, but it > is a simple test if gdb can call this function */ > - if (object && [object respondsTo: @selector(myDescription)]) > + if (object) > return [object myDescription]; > > return NULL; > diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp > index 856c96771c6..97a9692b4ce 100644 > --- a/gdb/testsuite/lib/gdb.exp > +++ b/gdb/testsuite/lib/gdb.exp > @@ -6884,15 +6884,11 @@ proc gdb_compile_shlib_pthreads {sources dest opt= ions} { > proc gdb_compile_objc {source dest type options} { > set built_binfile 0 > set why_msg "unrecognized error" > - foreach lib {-lobjc -lpthreads -lpthread -lthread solaris} { > + set base_libs {-lgnustep-base -lobjc} > + foreach lib {-lpthreads -lpthread -lthread "-lpthread -lposix4"} { > # This kind of wipes out whatever libs the caller may have > # set. Or maybe theirs will override ours. How infelicitous. > - if { $lib =3D=3D "solaris" } { > - set lib "-lpthread -lposix4" > - } > - if { $lib !=3D "-lobjc" } { > - set lib "-lobjc $lib" > - } > + set lib "$base_libs $lib" > set options_with_lib [concat $options [list libs=3D$lib quiet]] > set ccout [gdb_compile $source $dest $type $options_with_lib] > switch -regexp -- $ccout { > -- > 2.49.0 >