From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 75526 invoked by alias); 20 Sep 2017 16:49:34 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 75512 invoked by uid 89); 20 Sep 2017 16:49:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2335 X-HELO: mail-wr0-f172.google.com Received: from mail-wr0-f172.google.com (HELO mail-wr0-f172.google.com) (209.85.128.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 20 Sep 2017 16:49:32 +0000 Received: by mail-wr0-f172.google.com with SMTP id 108so2675222wra.5 for ; Wed, 20 Sep 2017 09:49:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=1j0UfKggKmwAyIpQxpE735DMcTjhwGh21YC1+U7l550=; b=fFGx0DT2GWXPkaS6wh0PIDTCLovsTiKfDD7iJJ6OZpVEYiS+UosxxAI0TEvZqEk3oX lG6YphDzo5ic93sYCooTkC820GeteM3QewPoHZvRvvz1JWT79RTmq7G3SSPvLj6T7Gmo jp9EihEddGor7rSBlQQBQSch72YMbEsfM35DiHbxLxzyOle2clDE+Q0EqsZzlsUP52ZX 2S80VGYs/uhCsrFF3EuF+MBVx6Kzzecf8uYBu7zWWjndl8n8vgxNugIuq7qzZEjTLpVQ k6CpRsPRrjogF2qG9cAbYB5X2AhaM9xxvcx9vUQcGHQmQ+C13QnDnYEE8Ck/M3tDkBsI JKgw== X-Gm-Message-State: AHPjjUioA6Dj0A9YxnZ1nkWlgaAMN/GCzyJ1K+9IYGaJqUPMytXMXELD Ty9N+WT+W/MHlryJ7rjMMMBmWw== X-Google-Smtp-Source: AOwi7QAMIyi+NlswpUHKQctJMhpzStuDfvF+1WYPiJ3ltfdP7Tad18e4RYbFWWIG5a5XwbnKWTPMCg== X-Received: by 10.223.187.16 with SMTP id r16mr4843520wrg.88.1505926169882; Wed, 20 Sep 2017 09:49:29 -0700 (PDT) Received: from E107787-LIN (static.42.136.251.148.clients.your-server.de. [148.251.136.42]) by smtp.gmail.com with ESMTPSA id j15sm2035166wre.87.2017.09.20.09.49.28 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 20 Sep 2017 09:49:29 -0700 (PDT) From: Yao Qi To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [RFC] Replicate src dir in build dir References: <1505832159-23038-1-git-send-email-yao.qi@linaro.org> <0aca31f3-4604-5630-baba-0584bb9d5c65@redhat.com> Date: Wed, 20 Sep 2017 16:49:00 -0000 In-Reply-To: <0aca31f3-4604-5630-baba-0584bb9d5c65@redhat.com> (Pedro Alves's message of "Wed, 20 Sep 2017 12:26:33 +0100") Message-ID: <86y3p99uy3.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00507.txt.bz2 Pedro Alves writes: > We've had to touch these lists several times recently to add some object = to > a bunch of triplets. It'd be nice to move the common CPU-specific files = to > variables shared by the different OS triplets, so that we'd have simple p= laces > to edit them. Similar to srv_i386_linux_regobj etc. in > gdbserver/configure.srv. This is about common CPU-specific files shared by different triplets. This makes think a little bit further, how do we handle common OS-specific files shared by different triplets? We can match triplet CPU part and OS part respectively, and append the right objects to gdb_target_obs, like this, i386_tobjs=3D"i386-tdep.o i386.o i387-tdep.o" amd64_tobjs=3D"amd64-tdep.o arch/amd64.o" gdb_target_obs=3D"" # Fill in gdb_target_obs according to CPU. case "${targ}" in aarch64*-*-*) gdb_target_obs=3D"aarch64-tdep.o aarch64-insn.o ${gdb_target_obs}";; arm*-*-*) gdb_target_obs=3D"arm.o arm-get-next-pcs.o arm-tdep.o ${gdb_target_= obs}";; i[34567]86-*-*) gdb_target_obs=3D"${i386_tobjs} ${gdb_target_obs}";; if test "x$enable_64_bit_bfd" =3D "xyes"; then gdb_target_obs=3D"${amd64_tobjs} ${gdb_target_obs}" fi sparc-*-*) gdb_target_obs=3D"sparc-tdep.o ravenscar-thread.o sparc-ravenscar-t= hread.o ${gdb_target_obs}";; sparc64-*-*) gdb_target_obs=3D"sparc-tdep.o sparc64-tdep.o ravenscar-thread.o sp= arc-ravenscar-thread.o ${gdb_target_obs}";; x86_64-*-*) gdb_target_obs=3D"${i386_tobjs} ${amd64_tobjs} ${gdb_target_obs}";; esac # Fill in gdb_target_obs according to OS. case "${targ}" in *-*-freebsd*) gdb_target_obs=3D"fbsd-tdep.o solib-svr4.o ${gdb_target_obs}";; *-*-netbsd*) gdb_target_obs=3D"nbsd-tdep.o solib-svr4.o ${gdb_target_obs}";; *-*-openbsd*) gdb_target_obs=3D"obsd-tdep.o solib-svr4.o ${gdb_target_obs}";; esac # Fill in the rest according to the triplet. ... What do you think? > > Like e.g.: > > + i386_tobjs=3D"i386-tdep.o i386.o i387-tdep.o" > + amd64_tobjs=3D"${i386_tobjs} amd64-tdep.o arch/amd64.o" > > And then use these variables throughout, like: > > x86_64-*-netbsd* | x86_64-*-knetbsd*-gnu) > # Target: NetBSD/amd64 > - gdb_target_obs=3D"amd64-tdep.o amd64.o amd64-nbsd-tdep.o i386-tdep.o \ > - i386.o i387-tdep.o nbsd-tdep.o solib-svr4.o" > + gdb_target_obs=3D"${amd64_tobjs} amd64-nbsd-tdep.o nbsd-tdep.o so= lib-svr4.o" --=20 Yao (=E9=BD=90=E5=B0=A7)