From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id csynG4Orz2DVKAAAWB0awg (envelope-from ) for ; Sun, 20 Jun 2021 16:56:35 -0400 Received: by simark.ca (Postfix, from userid 112) id 5BBD91F1F2; Sun, 20 Jun 2021 16:56:35 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 5FEEB1F1EE for ; Sun, 20 Jun 2021 16:56:34 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CD41C385380F for ; Sun, 20 Jun 2021 20:56:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CD41C385380F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1624222593; bh=lsyzrcqtSlqM0Z2i5yxpTivo4RTReikaYjbH7W98ub4=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=adDjIasXzvZRx+X952mwk5o0zDAwpaviVL5bYfcINV4xcfa6D700BzBLlIYw/IuWT HXutQfzP+x/uropNeFxCePXLzKCNUD36PTIDfv6xz4MwOMs5l5LTwZilYdxWB2Sw2E e/iyd9vMYXhi+Dfxi/7Bg825ONo4wwQqXwf23YeY= Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 1EE36385783A for ; Sun, 20 Jun 2021 20:56:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1EE36385783A Received: from vapier (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 49287335D97; Sun, 20 Jun 2021 20:56:11 +0000 (UTC) Date: Sun, 20 Jun 2021 16:56:08 -0400 To: Simon Marchi Subject: Re: [PATCH 1/3] sim: split sim/callback.h include out Message-ID: Mail-Followup-To: Simon Marchi , gdb-patches@sourceware.org References: <20210616063302.20722-1-vapier@gentoo.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mike Frysinger via Gdb-patches Reply-To: Mike Frysinger Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 20 Jun 2021 11:11, Simon Marchi wrote: > On 2021-06-16 2:33 a.m., Mike Frysinger via Gdb-patches wrote: > > The sim-basics.h is too big and includes too many things. This leads > > to some arch's sim-main.h having circular loop issues with defs, and > > makes it hard to separate out common objects from arch-specific defs. > > By splitting up sim-basics.h and killing off sim-main.h, it'll make > > it easier to separate out the two. > > > > Start with splitting out sim/callback.h. > > Starting with this patch (according to bisect), I get this link error: bisecting is why i've been doing small/medium patches and not giant dumps :). > make[3]: Entering directory '/home/simark/build/binutils-gdb/sim/erc32' > ccache gcc -DHAVE_CONFIG_H -DWITH_HW=1 -DHAVE_DV_SOCKSER -DDEFAULT_INLINE=0 -Wall -Wdeclaration-after-statement -Wpointer-arith -Wpointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wmissing-prototypes -Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type -Wold-style-declaration -I. -I/home/simark/src/binutils-gdb/sim/erc32 -I../common -I/home/simark/src/binutils-gdb/sim/erc32/../common -I../../include -I/home/simark/src/binutils-gdb/sim/erc32/../../include -I../../bfd -I/home/simark/src/binutils-gdb/sim/erc32/../../bfd -I../../opcodes -I/home/simark/src/binutils-gdb/sim/erc32/../../opcodes -I../.. -I/home/simark/src/binutils-gdb/sim/erc32/../../gnulib/import -I../../gnulib/import -DFAST_UART -I/home/simark/src/binutils-gdb/sim/erc32/../.. -g3 -O0 -fsanitize=address -fmax-errors=1 -fdiagnostics-color=always -o sis \ > sis.o exec.o erc32.o func.o help.o float.o ../common/common_libcommon_a-portability.o ../common/common_libcommon_a-sim-load.o ../common/common_libcommon_a-version.o ../../bfd/libbfd.a ../../opcodes/libopcodes.a ../../libiberty/libiberty.a -lm -ltinfo -ldl -lnsl -lz -lreadline -ltinfo -lm ../../gnulib/import/libgnu.a > /usr/bin/ld: ../common/common_libcommon_a-sim-load.o: warning: relocation against `current_target_byte_order' in read-only section `.text' > /usr/bin/ld: ../common/common_libcommon_a-sim-load.o: in function `LSEXTRACTED': > /home/simark/src/binutils-gdb/sim/common/sim-bits.c:64: undefined reference to `sim_io_error' this is weird. it builds fine for me with -O0. i just tried with sanitizers enabled too and still passes. all with gcc-11.1. but let's focus on the error. LSEXTRACTED doesn't call sim_io_error. it does call the ASSERT macro which might expand to calling sim_io_error, but that includes sim-io.h before using the func. so that part looks ok. sim_io_error is defined in sim-io.o. but erc32 doesn't link that in. but it also doesn't use it in general ... why does your sim-load have references to LSEXTRACTED et al in the first place ? sim-load doesn't use any of those APIs. i guess this gets back to your system not handling static/inline the way others are for some reason ? $ readelf -sW common/common_libcommon_a-sim-load.o | grep sim 1: 0000000000000000 0 FILE LOCAL DEFAULT ABS sim-load.c 17: 0000000000000127 990 FUNC GLOBAL DEFAULT 1 sim_load_file -mike