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 9A6403857831 for ; Tue, 16 Nov 2021 09:29:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9A6403857831 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-564-FHhYungVMgeFQ91byrXZ8Q-1; Tue, 16 Nov 2021 04:29:14 -0500 X-MC-Unique: FHhYungVMgeFQ91byrXZ8Q-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3D1A080A5C8; Tue, 16 Nov 2021 09:29:13 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.194.81]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5783A19723; Tue, 16 Nov 2021 09:29:10 +0000 (UTC) From: Florian Weimer To: Stan Cox , Stefan Liebler Cc: Arjun Shankar , libc-alpha@sourceware.org, systemtap@sourceware.org Subject: glibc build failure due to Systemtap probe change Date: Tue, 16 Nov 2021 10:29:08 +0100 Message-ID: <87a6i4e9ej.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: systemtap@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Systemtap mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2021 09:29:17 -0000 On Fedora rawhide, glibc no longer builds: In file included from ../include/stap-probe.h:25, from ../sysdeps/s390/s390-64/__longjmp.c:24: ../sysdeps/s390/s390-64/__longjmp.c: In function '__longjmp': ../sysdeps/s390/s390-64/__longjmp.c:52:50: error: expected ':' or ')' before numeric constant 52 | LIBC_PROBE_ASM (longjmp, 8@%1 -4@%0 8@%%r4) | ^ ../sysdeps/s390/s390-64/__longjmp.c:52:25: note: in expansion of macro 'LIBC_PROBE_ASM' 52 | LIBC_PROBE_ASM (longjmp, 8@%1 -4@%0 8@%%r4) | ^~~~~~~~~~~~~~ This is because of a Systemtap probe: | /* Jump to the position specified by ENV, causing the | setjmp call there to return VAL, or 1 if VAL is 0. */ | void | __longjmp (__jmp_buf env, int val) | { | #ifdef PTR_DEMANGLE | uintptr_t guard = THREAD_GET_POINTER_GUARD (); | # ifdef CHECK_SP | CHECK_SP (env, guard); | # endif | #elif defined CHECK_SP | CHECK_SP (env, 0); | #endif | register long int r2 __asm__ ("%r2") = val == 0 ? 1 : val; | #ifdef PTR_DEMANGLE | register uintptr_t r3 __asm__ ("%r3") = guard; | register void *r1 __asm__ ("%r1") = (void *) env; | #endif | /* Restore registers and jump back. */ | __asm__ __volatile__ ( | /* longjmp probe expects longjmp first argument, second | argument and target address. */ | #ifdef PTR_DEMANGLE | "lmg %%r4,%%r5,64(%1)\n\t" | "xgr %%r4,%2\n\t" | "xgr %%r5,%2\n\t" | LIBC_PROBE_ASM (longjmp, 8@%1 -4@%0 8@%%r4) | #else | LIBC_PROBE_ASM (longjmp, 8@%1 -4@%0 8@%%r14) | #endif My guess this is related to the macro changes to support floating point values in probes added in this commit: commit eaa15b047688175a94e3ae796529785a3a0af208 Author: Stan Cox Date: Thu Sep 30 16:11:29 2021 -0400 PR27829: Support floating point values passed through sdt.h markers Add the type to the individual arg entries in the .notes.stapsdt section; currently SP@A, where S is optional '-' sign, P is precision of type and A is address. Revised format is SPT@A where T is optional 'f' for float variables. Add x8664 float registers xmm8 - xmm15 and aarch64 float registers v8 - v31. Parse the type field; result is currently ignored. asm statements are restricted to 30 arguments; sdt probes can have up to 12 arguments. To fit this into a single asm statement, precision and type are encoded into a single field: 0xSSTT where SS is the precision and TT is the type as encoded by __builtin_classify_type. The sign S, precision P, and type T are decoded by _SDT_SIGN, _SDT_SIZE, and _SDT_TYPE. Test that the revised .notes.stapsdt section interacts correctly with eu-elfutils and gdb. The macro changes in this commit seem to trigger additional macro expansion in the preprocessor, and therefore require syntax closer to C. LIBC_PROBE_ASM was added to longjmp to support GDB, but if GDB really needs this, I'm not sure if Systemtap probes (via ) are the right mechanism because building with Systemtap support is optional. Maybe we should copy into the glibc sources, and then we could drop the floating point support again. 8-/ Or we could rewrite s390/s390x __longjmp in assembler. It's mostly assembler anyway. Stefan, what do you think? Thanks, Florian