From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by gnuweeb.org (Postfix) with ESMTPS id B25947E30F for ; Sun, 3 Apr 2022 15:06:59 +0000 (UTC) Authentication-Results: gnuweeb.org; dkim=pass (2048-bit key; unprotected) header.d=kernel-dk.20210112.gappssmtp.com header.i=@kernel-dk.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=HzVkX0R+; dkim-atps=neutral Received: by mail-pj1-f41.google.com with SMTP id bx5so6459872pjb.3 for ; Sun, 03 Apr 2022 08:06:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=FX7QNsp0biKzV8aC5OzTBLm4hvgNEiVozcPGEOt/SZI=; b=HzVkX0R+rICptCONDbN9DjpsPs6mTJ58sRXqvdcaoEWRBOGfC7Zpw0rrxgBY5zuA78 GMvPO0woKWf9HxYNgsODLs/Ge7jlKDZ7L74rUeJz0+zyfFf12yBgt4sQv24KYwFKiqcs vGxDb6yFVmcm/1WdF6PP2igowrhCjgMfTqUn4Ab7PPQRKwJGNujtTVc1HabiwKLWTayd fxqPek+kLIme9CIVdYeEqECKzGqBSXlHMBIBskK+yupVJvkbxN1lS62KqRRd6/PTkBt9 RGc8o16UkM5/RNqRD5Qdqb6f2maRBtV1ynyVvBQxF6W6w2sS/e7whtccfAqXk5bC64cM O1LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=FX7QNsp0biKzV8aC5OzTBLm4hvgNEiVozcPGEOt/SZI=; b=3F5eYfiuEKH0I9MKsFl3wKC7hg8qoZK8cJ3eGWalqtHmSrqxM40zEtWRSiyKdK9YJt eDaGAvvCatCnBtLbmqu3nqCp9hsJkYFNzfwSN9yX0RLCuU6IbpjxGcfHkdGrixd/eVfv atcX4MW6wI/B+C9Ga7prVFLJv8wplPas4Doc/DIZu+g8yfyZXpfTP4vDwZHAk54ES0eM kQfb39XB3jw7UYV5oCLbGHQL/MENe3Opqjz2/r0vtBjoCViBzMLTnL2ZHIPWSPbKTtxE TtLQ0UEKLuNra45iO0t9SKb2Nok6KC8zLiXjuXdXwPY38uqRaUV/Xn9Y20iNsC/4h/nM Q3TA== X-Gm-Message-State: AOAM532b2DkkbE/Gl3lTmcwdhVXQjzrdEcok+WWyE+9YrWmZTLaQdIEZ 7PmF4c0Sp0ScjJ5xufxUdoc99g== X-Google-Smtp-Source: ABdhPJyP7wB1C9Xjmt2emW51j45D2ZpRpcke2nT5I2o9tayUtZf33DgJnmUkpLeNy88La73qjcUXew== X-Received: by 2002:a17:90a:8595:b0:1bb:fbfd:bfbf with SMTP id m21-20020a17090a859500b001bbfbfdbfbfmr21738970pjn.125.1648998419108; Sun, 03 Apr 2022 08:06:59 -0700 (PDT) Received: from [192.168.1.100] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id c4-20020a17090a4d0400b001ca5cf3271csm4705418pjg.14.2022.04.03.08.06.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 03 Apr 2022 08:06:58 -0700 (PDT) Message-ID: <5f923e0c-9b0e-fac8-12ed-957f16c2d5ca@kernel.dk> Date: Sun, 3 Apr 2022 09:06:57 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH liburing v1 2/2] test/Makefile: Append `.test` to the test binary filename Content-Language: en-US To: Ammar Faizi Cc: io-uring Mailing List , GNU/Weeb Mailing List References: <20220403095602.133862-1-ammarfaizi2@gnuweeb.org> <20220403095602.133862-3-ammarfaizi2@gnuweeb.org> <5eb7b378-b0cf-83ff-7796-87a33517b1a0@kernel.dk> <0f33b074-9bed-2fe2-10f6-a36b1c3f63d3@kernel.dk> From: Jens Axboe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: On 4/3/22 9:05 AM, Ammar Faizi wrote: > On 4/3/22 10:00 PM, Jens Axboe wrote: >> On 4/3/22 8:55 AM, Ammar Faizi wrote: >>> On 4/3/22 9:51 PM, Jens Axboe wrote: >>>> On 4/3/22 3:56 AM, Ammar Faizi wrote: >>>>> When adding a new test, we often forget to add the new test binary to >>>>> `.gitignore`. Append `.test` to the test binary filename, this way we >>>>> can use a wildcard matching "test/*.test" in `.gitignore` to ignore all >>>>> test binary files. >>>> >>>> Did you build it? >>>> >>>> CC 917257daa0fe-test.test >>>> /usr/bin/ld: /tmp/ccGrhiuN.o: in function `thread_start': >>>> /home/axboe/git/liburing/test/35fa71a030ca-test.c:52: undefined reference to `pthread_attr_setstacksize' >>>> /usr/bin/ld: /home/axboe/git/liburing/test/35fa71a030ca-test.c:55: undefined reference to `pthread_create' >>>> CC a0908ae19763-test.test >>>> collect2: error: ld returned 1 exit status >>>> make[1]: *** [Makefile:210: 35fa71a030ca-test.test] Error 1 >>>> make[1]: *** Waiting for unfinished jobs.... >>>> /usr/bin/ld: /tmp/cc2nozDW.o: in function `main': >>>> /home/axboe/git/liburing/test/232c93d07b74-test.c:295: undefined reference to `pthread_create' >>>> /usr/bin/ld: /home/axboe/git/liburing/test/232c93d07b74-test.c:296: undefined reference to `pthread_create' >>>> /usr/bin/ld: /home/axboe/git/liburing/test/232c93d07b74-test.c:297: undefined reference to `pthread_join' >>>> /usr/bin/ld: /home/axboe/git/liburing/test/232c93d07b74-test.c:298: undefined reference to `pthread_join' >>>> collect2: error: ld returned 1 exit status >>>> make[1]: *** [Makefile:210: 232c93d07b74-test.test] Error 1 >>>> make[1]: Leaving directory '/home/axboe/git/liburing/test' >>>> >>>> I do like the idea of not having to keep fixing that gitignore list. >>> >>> Hmm.. weird... It builds just fine from my end. >>> Can you show the full commands? >> >> Sure, here it is: >> >> axboe@m1 ~/gi/liburing (master)> make V=1 0.011s > > OK, it now makes sense to me. > > These pthread stuff are appended for the test binary files without "*.test" suffix. > > 35fa71a030ca-test: override LDFLAGS += -lpthread > 232c93d07b74-test: override LDFLAGS += -lpthread > send_recv: override LDFLAGS += -lpthread > send_recvmsg: override LDFLAGS += -lpthread > poll-link: override LDFLAGS += -lpthread > accept-link: override LDFLAGS += -lpthread > submit-reuse: override LDFLAGS += -lpthread > poll-v-poll: override LDFLAGS += -lpthread > across-fork: override LDFLAGS += -lpthread > ce593a6c480a-test: override LDFLAGS += -lpthread > wakeup-hang: override LDFLAGS += -lpthread > pipe-eof: override LDFLAGS += -lpthread > timeout-new: override LDFLAGS += -lpthread > thread-exit: override LDFLAGS += -lpthread > ring-leak2: override LDFLAGS += -lpthread > poll-mshot-update: override LDFLAGS += -lpthread > exit-no-cleanup: override LDFLAGS += -lpthread > pollfree: override LDFLAGS += -lpthread > msg-ring: override LDFLAGS += -lpthread > recv-msgall: override LDFLAGS += -lpthread > recv-msgall-stream: override LDFLAGS += -lpthread > > I don't know why my linker doesn't complain about that. > > What about appending -lpthread to all tests and remove all of these > override stuff? Are you okay with that? > > Or do you prefer to append -lpthread for only test that needs pthread? Nah I think that's fine, also saves some hassle when you add a new test that does use pthread. -- Jens Axboe