From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from fencepost.gnu.org (fencepost.gnu.org [IPv6:2001:470:142:3::e]) by sourceware.org (Postfix) with ESMTPS id 887573858D3C for ; Sun, 3 Oct 2021 23:55:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 887573858D3C Received: from eggs.gnu.org ([2001:470:142:3::10]:47272) by fencepost.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXBK6-000822-Rm for gcc-help@gnu.org; Sun, 03 Oct 2021 19:55:36 -0400 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]:35619) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXBK5-0005lJ-8J for gcc-help@gnu.org; Sun, 03 Oct 2021 19:55:14 -0400 Received: by mail-ed1-x533.google.com with SMTP id b8so23407986edk.2 for ; Sun, 03 Oct 2021 16:55:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yWv8fm6wV/ueAd2Ov6K54I/yiK51ZH42TMocDd2M7Ng=; b=fwdm2ELc0IjMylkqtgCYrHqWTdvjL67juuV9lWZ3TmKE/NSvoDu+ncw3X44gkBqhr8 wq0Q6kF4q9xOYTszZPvMDouN80Omvf5R94vonWLigmKVx7ecRVJZryR1sd/id+BGuBHk MgwFffikSOAHdQWFH3ssYp9M2FtMqwvH7ArCq8Grf8+xso66S4MW/yCPQWlgPFdz9pCR a04ayKZCkMsWnacwE8lUXiRWtGFEGJztwKTweSt9GGbkzNudj/q20k0FVMMsDxJ5JPc4 7TiHM7oLNHbk+20AgqG2V9RqP7QguoSJwYgciaAGzxhKvdu+fcStS8JgP55lh2bMhHxq 0eRg== X-Gm-Message-State: AOAM531NFbQR+AgR6a1hc1FFXRXEwjtNDeGXZL9nchARSHrW6r+Hi8IF JksJD5moSS2SJ5ysevPSpH3pLHBRtX02rcCTNYc= X-Google-Smtp-Source: ABdhPJy7a/dlJJHFwx41YTQEHz71JG1s9u4bBe7g26KlWu1rHBwnEEY44wE7uJFHrzlUVPz8JvmtyKHwU+2eRQu98Tg= X-Received: by 2002:a17:906:60c3:: with SMTP id f3mr13256354ejk.561.1633305310826; Sun, 03 Oct 2021 16:55:10 -0700 (PDT) MIME-Version: 1.0 References: <8779cddc-8c5f-1220-a393-719fc6f7ba12@gmail.com> In-Reply-To: <8779cddc-8c5f-1220-a393-719fc6f7ba12@gmail.com> From: Tom Kacvinsky Date: Sun, 3 Oct 2021 19:55:00 -0400 Message-ID: Subject: Re: gcc and simple C compiler To: Bill Cunningham Cc: gcc-help@gnu.org Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=tkacvins@gmail.com; helo=mail-ed1-x533.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2021 23:55:38 -0000 On Sun, Oct 3, 2021 at 7:48 PM Bill Cunningham via Gcc-help < gcc-help@gcc.gnu.org> wrote: > Greetings I was wondering if there was a way I could compile a simple C > only compiler, as a learning experience, and just "extract" a simple C99 > compiler. To explain better, would there be a log or pathway that gcc > would create if I properly set the switches ec cetra to compile a C99 > compiler for the x86_64-pc-linux-gnu target and the log would show me > all the files used and I could "move" those files to a directory and > have a simple, smaller, gcc C compiler. > > This is for my own use to learn gcc and not to be made public. Use configure with --enable-languages=c This means only the C compiler is built. No C++, no Fortran, Objective C, etc... Of course you need a working C compiler to compile GCC. I don't know what system you're working on, but later versions of Linux distributions should have a new enough GCC to compile GCC from source. Also of note, the way GCC is currently built is such that the installation is relocatable. Say you install it into /usr/local/gcc. Then you can take the entire contents of /usr/local/gcc and move them to /opt/gcc and what is in the new location will Just Work (TM). Tom