Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

If it's worth hacking on well, it's worth hacking on for money.


devel / comp.lang.c / Re: Build Systems

SubjectAuthor
* Build SystemsBart
+* Re: Build SystemsBen Bacarisse
|+* Re: Build SystemsBart
||`* Re: Build SystemsBen Bacarisse
|| `* Re: Build SystemsScott Lurndal
||  +* Re: Build SystemsKenny McCormack
||  |+* Re: Build SystemsMalcolm McLean
||  ||`* Dev on Windoze (Was: Build Systems)Kenny McCormack
||  || +- Re: Dev on Windoze (Was: Build Systems)Malcolm McLean
||  || +* Re: Dev on Windoze (Was: Build Systems)Matthew Ernisse
||  || |+- Re: Dev on Windoze (Was: Build Systems)Michael S
||  || |+* Re: Dev on Windoze (Was: Build Systems)bart c
||  || ||`- Re: Dev on Windoze (Was: Build Systems)Matthew Ernisse
||  || |`* Re: Dev on WindozePhil Carmody
||  || | `- Re: Dev on WindozeChris M. Thomasson
||  || `- Re: Dev on Windoze (Was: Build Systems)Chris M. Thomasson
||  |`* Re: Build SystemsKaz Kylheku
||  | `* Re: Build SystemsKenny McCormack
||  |  `- Re: Build SystemsKarl Meyer
||  `- Re: Build SystemsBart
|`* Re: Build SystemsDavid Brown
| `* Re: Build SystemsBart
|  +* Re: Build SystemsScott Lurndal
|  |`* Re: Build SystemsBart
|  | `* Re: Build SystemsDavid Brown
|  |  +* Re: Build SystemsBart
|  |  |`* Re: Build SystemsDavid Brown
|  |  | `* Re: Build SystemsBart
|  |  |  +- Re: Build SystemsScott Lurndal
|  |  |  +* Re: Build SystemsMJ OS_EXAMINE
|  |  |  |+- Re: Build SystemsKenny McCormack
|  |  |  |`- Re: Build SystemsBart
|  |  |  +* Re: Build SystemsDavid Brown
|  |  |  |+* Re: Build SystemsScott Lurndal
|  |  |  ||+- Re: Build SystemsKenny McCormack
|  |  |  ||+- Re: Build SystemsPhil Carmody
|  |  |  ||`- Re: Build SystemsDavid Brown
|  |  |  |`* Re: Build SystemsBart
|  |  |  | +- Re: Build SystemsKeith Thompson
|  |  |  | `* Re: Build SystemsDavid Brown
|  |  |  |  `* Re: Build SystemsBart
|  |  |  |   +* Re: Build SystemsKeith Thompson
|  |  |  |   |`* Re: Build SystemsBart
|  |  |  |   | +- Re: Build SystemsKaz Kylheku
|  |  |  |   | `* Re: Build SystemsDavid Brown
|  |  |  |   |  `* Re: Build SystemsBart
|  |  |  |   |   `* Re: Build SystemsDavid Brown
|  |  |  |   |    +- Re: Build SystemsBart
|  |  |  |   |    +* Re: Build SystemsBart
|  |  |  |   |    |+* Re: Build SystemsScott Lurndal
|  |  |  |   |    ||`- Re: Build SystemsBart
|  |  |  |   |    |+* Re: Build SystemsBen Bacarisse
|  |  |  |   |    ||`* Re: Build SystemsBart
|  |  |  |   |    || +* Re: Build SystemsRichard Harnden
|  |  |  |   |    || |`- Re: Build SystemsBart
|  |  |  |   |    || `* Re: Build SystemsBen Bacarisse
|  |  |  |   |    ||  `* Re: Build SystemsBart
|  |  |  |   |    ||   `* Re: Build SystemsBen Bacarisse
|  |  |  |   |    ||    `* Re: Build SystemsBart
|  |  |  |   |    ||     `- Re: Build SystemsBen Bacarisse
|  |  |  |   |    |`* Re: Build SystemsDavid Brown
|  |  |  |   |    | `* Re: Build SystemsBart
|  |  |  |   |    |  +* Re: Build SystemsKeith Thompson
|  |  |  |   |    |  |`* Re: Build Systemsbart c
|  |  |  |   |    |  | `* Re: Build SystemsKeith Thompson
|  |  |  |   |    |  |  `* Re: Build SystemsDavid Brown
|  |  |  |   |    |  |   `* Re: Build SystemsChris M. Thomasson
|  |  |  |   |    |  |    +- Re: Build SystemsChris M. Thomasson
|  |  |  |   |    |  |    +* Re: Build SystemsKeith Thompson
|  |  |  |   |    |  |    |`- Re: Build SystemsChris M. Thomasson
|  |  |  |   |    |  |    `* Re: Build SystemsDavid Brown
|  |  |  |   |    |  |     +- Re: Build SystemsChris M. Thomasson
|  |  |  |   |    |  |     `* Re: Build SystemsChris M. Thomasson
|  |  |  |   |    |  |      +* Re: Build Systemsjames...@alumni.caltech.edu
|  |  |  |   |    |  |      |+- Re: Build Systemscandycane
|  |  |  |   |    |  |      |`* Re: Build SystemsKaz Kylheku
|  |  |  |   |    |  |      | `* Re: Build SystemsDavid Brown
|  |  |  |   |    |  |      |  `- Re: Build SystemsChris M. Thomasson
|  |  |  |   |    |  |      `* Re: Build SystemsDavid Brown
|  |  |  |   |    |  |       `- Re: Build SystemsChris M. Thomasson
|  |  |  |   |    |  +* Re: Build SystemsKaz Kylheku
|  |  |  |   |    |  |`* Re: Build Systemsbart c
|  |  |  |   |    |  | `* Re: Build SystemsBen Bacarisse
|  |  |  |   |    |  |  +* Re: Build Systemsbart c
|  |  |  |   |    |  |  |+* Re: Build SystemsDavid Brown
|  |  |  |   |    |  |  ||`- Re: Build Systemsbart c
|  |  |  |   |    |  |  |+* Re: Build SystemsKelsey Bjarnason
|  |  |  |   |    |  |  ||`* Re: Build Systemsbart c
|  |  |  |   |    |  |  || `* Re: Build SystemsKelsey Bjarnason
|  |  |  |   |    |  |  ||  `* Re: Build Systemsbart c
|  |  |  |   |    |  |  ||   `* Re: Build SystemsKelsey Bjarnason
|  |  |  |   |    |  |  ||    `* Re: Build SystemsBart
|  |  |  |   |    |  |  ||     `* Re: Build SystemsKelsey Bjarnason
|  |  |  |   |    |  |  ||      +* Re: Build SystemsBart
|  |  |  |   |    |  |  ||      |+* Re: Build SystemsBart
|  |  |  |   |    |  |  ||      ||`* Re: Build SystemsRichard Harnden
|  |  |  |   |    |  |  ||      || `- Re: Build SystemsBart
|  |  |  |   |    |  |  ||      |`* Re: Build SystemsScott Lurndal
|  |  |  |   |    |  |  ||      | `* Re: Build SystemsBart
|  |  |  |   |    |  |  ||      |  +* Re: Build SystemsMalcolm McLean
|  |  |  |   |    |  |  ||      |  |`- Re: Build SystemsBart
|  |  |  |   |    |  |  ||      |  +- Re: Build SystemsScott Lurndal
|  |  |  |   |    |  |  ||      |  +* Re: Build SystemsScott Lurndal
|  |  |  |   |    |  |  ||      |  +- Re: Build SystemsChris M. Thomasson
|  |  |  |   |    |  |  ||      |  `- Re: Build SystemsChris M. Thomasson
|  |  |  |   |    |  |  ||      `- Re: Build SystemsKaz Kylheku
|  |  |  |   |    |  |  |`* Re: Build SystemsBen Bacarisse
|  |  |  |   |    |  |  `* Re: Build SystemsScott Lurndal
|  |  |  |   |    |  `* Re: Build SystemsDavid Brown
|  |  |  |   |    `* Re: Build SystemsBart
|  |  |  |   `* Re: Build SystemsDavid Brown
|  |  |  `* Re: Build SystemsKeith Thompson
|  |  `- Really? (Was: Build Systems)Kenny McCormack
|  `* Re: Build SystemsDavid Brown
+* Re: Build SystemsDavid Brown
+- Re: Build SystemsThiago Adams
`- Re: Build SystemsMichael S

Pages:12345678910111213
Re: Build Systems

<20230819085418.391@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27934&group=comp.lang.c#27934

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: Build Systems
Date: Sat, 19 Aug 2023 15:59:01 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <20230819085418.391@kylheku.com>
References: <uban99$1rnpb$1@dont-email.me> <ubgpip$2vk5e$1@dont-email.me>
<ubgulr$3095n$1@dont-email.me> <87pm3nlxuu.fsf@nosuchdomain.example.com>
<ubh3s8$30v7t$1@dont-email.me> <ubi5do$38ii5$1@dont-email.me>
<ubib54$39aqa$1@dont-email.me> <ubii7m$3acds$1@dont-email.me>
<ubivp8$3cjsl$1@dont-email.me> <ubl89c$3prfv$1@dont-email.me>
<ubma81$3upnp$1@dont-email.me> <20230817183700.915@kylheku.com>
<011f0102-1241-464c-b628-0350c0be29fbn@googlegroups.com>
<87cyzjx4ob.fsf@bsb.me.uk> <Hx4EM.686038$TPw2.217661@fx17.iad>
<db175a13-352a-461b-88e4-d37e14d1a6e2n@googlegroups.com>
Injection-Date: Sat, 19 Aug 2023 15:59:01 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="588828d29d125ee26b6c8f373c219d7a";
logging-data="973259"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19IlDeYWbzWIBN0zSYQWN3vWxA7Wgv/05k="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:69NsO4C4R4GyUCe+PCLMM/9dgQY=
 by: Kaz Kylheku - Sat, 19 Aug 2023 15:59 UTC

On 2023-08-19, bart c <bart4858@gmail.com> wrote:
> On Saturday, 19 August 2023 at 15:43:02 UTC+1, Scott Lurndal wrote:
>> Ben Bacarisse <ben.u...@bsb.me.uk> writes:
>> >bart c <bart...@gmail.com> writes:
>> >
>>
>> >>
>> >> on those other programs is anathema.
>> >
>> >Well (if you are talking about having to say gcc prog.c rather than gcc
>> >prog) there are advantages, and none of them have anything to do with
>> >how much one has to type. After all, command completion means I rarely
>> >type a file name explcitly anyway.
>> >
>> It's worth repeating that 'gcc' is a driver program, not a compiler.
>>
>> So:
>>
>> $ gcc -c -o a.o a.s
>>
>> is a perfectly legal and viable way to invoke the assembler.
>>
>> $ gcc -o a a.o
>>
>> is a perfectly legal and viable way to invoke the linker.
>
> You can run the assembler directly using 'as', and the linker using 'ld'.

Not reliably. The gcc driver is configured to use a particular
assembler, not necessarily the one found in you PATH under the
name "as".

You might have an "as" that came from your Unix vendor, but gcc
was built with the GNU assembler.

You could have different installations of gcc with different
versions of an assembler.

> So how do you directly invoke the actual C compiler?

That's an executable usually called cc1. You have to know where
that is. Even if gcc is in your PATH, cc1 won't be.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: Build Systems

<20230819085912.518@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27935&group=comp.lang.c#27935

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: Build Systems
Date: Sat, 19 Aug 2023 16:00:23 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <20230819085912.518@kylheku.com>
References: <uban99$1rnpb$1@dont-email.me> <ubdmk4$2dao7$1@dont-email.me>
<ubfeqj$2oop4$1@dont-email.me> <ubfknf$2plvs$1@dont-email.me>
<ubfu4d$2r98d$1@dont-email.me> <ubg4jr$2se4o$1@dont-email.me>
<ubg7ku$2srfk$1@dont-email.me> <ubgdr5$2tro0$1@dont-email.me>
<ubgpip$2vk5e$1@dont-email.me> <ubgulr$3095n$1@dont-email.me>
<ubi4id$38esc$1@dont-email.me>
<7fb8d5b6-4172-4bf8-a3e9-858d02b5e193n@googlegroups.com>
<ubi9pf$394g8$2@dont-email.me>
<d0fbf07d-f1b5-4aa8-ac8e-a954addb6358n@googlegroups.com>
<zvrDM.215514$uLJb.196259@fx41.iad> <87sf8f9tq8.fsf@fatphil.org>
<cd21da1c-859b-4b22-90c6-87cf19ab250bn@googlegroups.com>
<ubqkkv$sjb3$1@dont-email.me>
Injection-Date: Sat, 19 Aug 2023 16:00:23 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="588828d29d125ee26b6c8f373c219d7a";
logging-data="973259"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1930jp0/42fjJPg1Wnb7v3dWAdTwPXHWgA="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:3MYjbpJmJ7iX3cJIl14AM7lO6hg=
 by: Kaz Kylheku - Sat, 19 Aug 2023 16:00 UTC

On 2023-08-19, David Brown <david.brown@hesbynett.no> wrote:
> On 19/08/2023 13:39, bart c wrote:
>> That's interesting. One of the limitations of Lua was that it didn't have proper integer type, it used a 64-bit float.
>>
>
> Lua is configurable, and can support different types. When I embedded
> in a 32-bit microcontroller program, I use 32-bit integers as the number
> type.

I don't feel the party has properly started until someone makes that
sort of thing a command line option. Or better yet, environment
variable.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: Build Systems

<nv76rj-6r2.ln1@spanky.localhost.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27936&group=comp.lang.c#27936

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: kbjarna...@gmail.com (Kelsey Bjarnason)
Newsgroups: comp.lang.c
Subject: Re: Build Systems
Date: Sat, 19 Aug 2023 00:35:51 -0700
Organization: A noiseless patient Spider
Lines: 123
Message-ID: <nv76rj-6r2.ln1@spanky.localhost.net>
References: <uban99$1rnpb$1@dont-email.me> <12sCM.59051$m8Ke.22097@fx08.iad>
<ubdmk4$2dao7$1@dont-email.me> <ubfeqj$2oop4$1@dont-email.me>
<ubfknf$2plvs$1@dont-email.me> <ubfu4d$2r98d$1@dont-email.me>
<ubg4jr$2se4o$1@dont-email.me> <ubg7ku$2srfk$1@dont-email.me>
<ubgdr5$2tro0$1@dont-email.me> <ubgpip$2vk5e$1@dont-email.me>
<ubgulr$3095n$1@dont-email.me> <87pm3nlxuu.fsf@nosuchdomain.example.com>
<ubh3s8$30v7t$1@dont-email.me> <ubi5do$38ii5$1@dont-email.me>
<ubib54$39aqa$1@dont-email.me> <ubii7m$3acds$1@dont-email.me>
<ubivp8$3cjsl$1@dont-email.me> <ubl89c$3prfv$1@dont-email.me>
<ubma81$3upnp$1@dont-email.me> <20230817183700.915@kylheku.com>
<011f0102-1241-464c-b628-0350c0be29fbn@googlegroups.com>
<87cyzjx4ob.fsf@bsb.me.uk>
<66629235-f2e0-46e0-bcb1-bf3abe1e33cdn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: dont-email.me; posting-host="6e7f951ddf49aa1da1fc945fcae855bf";
logging-data="980211"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX195cqkNi3U92ay4oV70bIBCV0SHPu0fXjw="
User-Agent: Pan/0.154 (Izium; 517acf4)
Cancel-Lock: sha1:HYN4Zz6r+ac1BSb8fT+9SrZJ6TI=
 by: Kelsey Bjarnason - Sat, 19 Aug 2023 07:35 UTC

On Fri, 18 Aug 2023 18:36:51 -0700 (PDT), bart c wrote:

> On Saturday, 19 August 2023 at 01:21:58 UTC+1, Ben Bacarisse wrote:
>> bart c <bart...@gmail.com> writes:
>
>> > That is, you want to be able to type:
>> >
>> > X
>> >
>> > and not:
>> >
>> > X Y
>> No, I want to type
>>
>> make make tests make install make clean make mylib.a
>
> I'm not familiar with how make is used. Do you routinely have to invoke
> it five times in succession? Maybe that's a deeper problem with it, but
> as I said I don't use it.
>
>> depending on what I'm doing rather than
>>
>> make makefile make makefile tests make makefile install make makefile
>> clean make makefile mylib.a
>
> And this actually tells me that the main input is identical in all
> cases; I'd been wondering what was being done with mylib.a. But whatever
> it is, the same makefile that does all the other stuff contains some
> formula for 'mylib.a'?
>
> In practice I doubt you would type this five times as normally you'd do
> line recall then change the last bit. You can also choose to give it a
> shorter name than 'makefile'!

No, normally you'd do something like:

make && make tests && make install && make clean && make mylib.a

Then get a coffee while it does all of these in succession.

>> What's more, tab completion in my shell works with make's targets, but
>> I don't think that's at all easy to do if the makefile has to be named
>> in the same command.
>> > like nearly every other command line program.
>>
>> > Yet being able to do
>> >
>> > X Y
>> >
>> > instead of:
>> >
>> > X Y.Z
>> >
>> > on those other programs is anathema.
>> Well (if you are talking about having to say gcc prog.c rather than gcc
>> prog) there are advantages, and none of them have anything to do with
>> how much one has to type. After all, command completion means I rarely
>> type a file name explcitly anyway.
>
> If my C test folder, I had 23 files that started with 'hello'. Although
> they are stepped through in alphabetical order on Windows and .c is near
> the top, you still have to tentatively keep pressing tab, then you go
> too far and need shift-tab .. it is quicker just to type the extension!
> Better however not to have to bother.

A good argument for sensible file naming conventions, one would think.

>> The main advantage is that there's no need to specify and remember all
>> the rules. Does gcc always add .c? Will it add .c if I type gcc prog.s?
>> Must I avoid any dots in the basename? What happens when several names
>> appear on the command line?
>
> gcc is a bad example to follow since it does too much on the command
> line and performs multiple functions. So it easy to argue that, because
> it handles 58 different file types (I've no idea), singling one out to
> use a default is senseless.
>
> But with a simpler product whose primary input files are C source files,
> then a default .c extension makes a lot of sense.
>
> The rules on Windows can be simple: if there is no extension (no dot in
> the name), then a default extension is added. It's harder with a Linux
> file system because files "abc" and "abc." are distinct; how to do apply
> a default extension to "abc" when that could be a valid filename?

One might think you don't; if I tell a compiler to compile "file", I would
expect it to compile "file", not "file.c" or "file.cpp" or "file.asm". If
it can't determine the language other than by file extension, then it's up
to me to ensure the files have the proper extension, and I tell it which
to compile. Using your sort of examples, I might have file.c, file.cpp
and file.asm in the directory - which one is it supposed to choose if I
tell it to just compile "file"?

> However on Windows and various other OSes before that over decades, it
> hasn't really given any problems.
>
>> > So either 'X Y' is too much to type, or `X Y' is not enough! Even
>> > though you will be using the latter case more often.
>> No. I don't think anyone cares about how much one types (I don't)
>> provided there is some point to it. It's annoying to be forced to type
>> something redundant every time, whereas it's potentially confusing to
>> have gcc pick default extensions.
>
> Exactly. I consider the '.c -oprog' in 'gcc prog.c -oprog' to be
> redundant. Note that on Windows, it will apply the .exe extension to
> that output.

You don't need to specify -oprog if you don't want; you just wind up with
a.out instead of prog as the result. Entirely up to you.

>> > It's fascinating watching psychology and group-think at work.
>> As usual, you've invented a position (it'a all about the typing) and
>> argued about that instead of taking on board the actual comments that
>> people have made.
>
> The typing is part of it. Using the same default file in this case seem
> to me to be fragile. Remember the Github Lua with the missing makefile?
> I didn't know there were supposed to be two, and assume that one called
> 'makefile' was /the/ makefile. Or someone could simply be in the wrong
> folder.

Re: Build Systems

<90c361f7-0dfd-4f08-98a9-21efa83ab729n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27937&group=comp.lang.c#27937

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:904:b0:649:afa4:5cab with SMTP id dj4-20020a056214090400b00649afa45cabmr14291qvb.6.1692461122299;
Sat, 19 Aug 2023 09:05:22 -0700 (PDT)
X-Received: by 2002:a17:902:cecc:b0:1bc:6799:3f88 with SMTP id
d12-20020a170902cecc00b001bc67993f88mr937486plg.0.1692461121874; Sat, 19 Aug
2023 09:05:21 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 19 Aug 2023 09:05:21 -0700 (PDT)
In-Reply-To: <35f2a7a9-7869-44e4-ba41-745440baeba5n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=145.14.19.203; posting-account=pysjKgkAAACLegAdYDFznkqjgx_7vlUK
NNTP-Posting-Host: 145.14.19.203
References: <uban99$1rnpb$1@dont-email.me> <87ttt2isc8.fsf@bsb.me.uk>
<ubd8t6$2b62u$1@dont-email.me> <ubdbtc$2bl3l$1@dont-email.me>
<12sCM.59051$m8Ke.22097@fx08.iad> <ubdmk4$2dao7$1@dont-email.me>
<ubfeqj$2oop4$1@dont-email.me> <ubfknf$2plvs$1@dont-email.me>
<ubfu4d$2r98d$1@dont-email.me> <ubg4jr$2se4o$1@dont-email.me>
<ubg7ku$2srfk$1@dont-email.me> <ubgdr5$2tro0$1@dont-email.me>
<ubgpip$2vk5e$1@dont-email.me> <ubgulr$3095n$1@dont-email.me>
<ubi4id$38esc$1@dont-email.me> <7fb8d5b6-4172-4bf8-a3e9-858d02b5e193n@googlegroups.com>
<ubi9pf$394g8$2@dont-email.me> <ublq7g$3skme$1@dont-email.me>
<ubo03m$9ukr$1@dont-email.me> <20cd8b90-23f6-4c04-9dbb-88f46aadc8c7n@googlegroups.com>
<ubqfcb$r8ff$1@dont-email.me> <35f2a7a9-7869-44e4-ba41-745440baeba5n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <90c361f7-0dfd-4f08-98a9-21efa83ab729n@googlegroups.com>
Subject: Re: Build Systems
From: oot...@hot.ee (Öö Tiib)
Injection-Date: Sat, 19 Aug 2023 16:05:22 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2891
 by: Öö Tiib - Sat, 19 Aug 2023 16:05 UTC

On Saturday, 19 August 2023 at 17:58:15 UTC+3, bart c wrote:
> On Saturday, 19 August 2023 at 14:17:15 UTC+1, David Brown wrote:

> >
> > So if you were to post saying you'd made a nice little bytecode
> > interpreter for a small IL/IR, suitable for some kinds of simple
> > scripting, I might say that's great. When you then say your tool is
> > practically the same as llvm and the llvm developers are clearly
> > incompetent and inefficient, /then/ you get the negative feedback.
>
> And I asked you what was the difference between getting the task done by my product, and the same task via LLVM. You haven't answered that.
>
But that is trivial as everything is different, no difference how
to look at it ... nothing matches.
Workforce: Single person might get tired and his confronting
everything around is bad signal.
Tools: You claim all tools are bad.
Optimizations: LLVM is designed for compile-time, link-time,
run-time, and "idle-time" optimization.
Compatibility: LLVM is potentially compatible with any architecture.

Re: Build Systems

<45028397-a7aa-4243-afa3-2751a6d5ef8en@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27938&group=comp.lang.c#27938

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ad4:4ba1:0:b0:649:afa4:5cac with SMTP id i1-20020ad44ba1000000b00649afa45cacmr12999qvw.0.1692463090077;
Sat, 19 Aug 2023 09:38:10 -0700 (PDT)
X-Received: by 2002:a05:6a00:2d07:b0:68a:2c24:57d7 with SMTP id
fa7-20020a056a002d0700b0068a2c2457d7mr928223pfb.0.1692463089664; Sat, 19 Aug
2023 09:38:09 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 19 Aug 2023 09:38:08 -0700 (PDT)
In-Reply-To: <20230819085418.391@kylheku.com>
Injection-Info: google-groups.googlegroups.com; posting-host=94.175.38.125; posting-account=rqC7UgoAAACeVvrGykivrxfPIl3bA_1y
NNTP-Posting-Host: 94.175.38.125
References: <uban99$1rnpb$1@dont-email.me> <ubgpip$2vk5e$1@dont-email.me>
<ubgulr$3095n$1@dont-email.me> <87pm3nlxuu.fsf@nosuchdomain.example.com>
<ubh3s8$30v7t$1@dont-email.me> <ubi5do$38ii5$1@dont-email.me>
<ubib54$39aqa$1@dont-email.me> <ubii7m$3acds$1@dont-email.me>
<ubivp8$3cjsl$1@dont-email.me> <ubl89c$3prfv$1@dont-email.me>
<ubma81$3upnp$1@dont-email.me> <20230817183700.915@kylheku.com>
<011f0102-1241-464c-b628-0350c0be29fbn@googlegroups.com> <87cyzjx4ob.fsf@bsb.me.uk>
<Hx4EM.686038$TPw2.217661@fx17.iad> <db175a13-352a-461b-88e4-d37e14d1a6e2n@googlegroups.com>
<20230819085418.391@kylheku.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <45028397-a7aa-4243-afa3-2751a6d5ef8en@googlegroups.com>
Subject: Re: Build Systems
From: bart4...@gmail.com (bart c)
Injection-Date: Sat, 19 Aug 2023 16:38:10 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3767
 by: bart c - Sat, 19 Aug 2023 16:38 UTC

On Saturday, 19 August 2023 at 16:59:16 UTC+1, Kaz Kylheku wrote:
> On 2023-08-19, bart c <bart...@gmail.com> wrote:
> > On Saturday, 19 August 2023 at 15:43:02 UTC+1, Scott Lurndal wrote:
> >> Ben Bacarisse <ben.u...@bsb.me.uk> writes:
> >> >bart c <bart...@gmail.com> writes:
> >> >
> >>
> >> >>
> >> >> on those other programs is anathema.
> >> >
> >> >Well (if you are talking about having to say gcc prog.c rather than gcc
> >> >prog) there are advantages, and none of them have anything to do with
> >> >how much one has to type. After all, command completion means I rarely
> >> >type a file name explcitly anyway.
> >> >
> >> It's worth repeating that 'gcc' is a driver program, not a compiler.
> >>
> >> So:
> >>
> >> $ gcc -c -o a.o a.s
> >>
> >> is a perfectly legal and viable way to invoke the assembler.
> >>
> >> $ gcc -o a a.o
> >>
> >> is a perfectly legal and viable way to invoke the linker.
> >
> > You can run the assembler directly using 'as', and the linker using 'ld'.
> Not reliably. The gcc driver is configured to use a particular
> assembler, not necessarily the one found in you PATH under the
> name "as".
>
> You might have an "as" that came from your Unix vendor, but gcc
> was built with the GNU assembler.
>
> You could have different installations of gcc with different
> versions of an assembler.
> > So how do you directly invoke the actual C compiler?
> That's an executable usually called cc1. You have to know where
> that is. Even if gcc is in your PATH, cc1 won't be.

I found cc1, but how do you use it? There's no conventional CLI. You can do:

cc1 <hello.c

but it needs a bunch of options. 'cci --help' produces a list of 1700 options, which is as helpful as saying that this week's winning lottery numbers are in the set 1 to 49.

I get the feeling it is not meant to be used from the command line like 'as' and 'ld'.

So, there /is/ no proper C-specific compiler with a normal interface; we're stuck with that driver.

Re: Build Systems

<94380001-0115-4e3e-9274-168d3e3a9573n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27939&group=comp.lang.c#27939

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:3b07:b0:76a:ece9:d898 with SMTP id tl7-20020a05620a3b0700b0076aece9d898mr12715qkn.8.1692464090921;
Sat, 19 Aug 2023 09:54:50 -0700 (PDT)
X-Received: by 2002:a17:902:ce8e:b0:1b8:95fc:d0f with SMTP id
f14-20020a170902ce8e00b001b895fc0d0fmr1099781plg.7.1692464090447; Sat, 19 Aug
2023 09:54:50 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!3.us.feeder.erje.net!feeder.erje.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 19 Aug 2023 09:54:49 -0700 (PDT)
In-Reply-To: <nv76rj-6r2.ln1@spanky.localhost.net>
Injection-Info: google-groups.googlegroups.com; posting-host=94.175.38.125; posting-account=rqC7UgoAAACeVvrGykivrxfPIl3bA_1y
NNTP-Posting-Host: 94.175.38.125
References: <uban99$1rnpb$1@dont-email.me> <12sCM.59051$m8Ke.22097@fx08.iad>
<ubdmk4$2dao7$1@dont-email.me> <ubfeqj$2oop4$1@dont-email.me>
<ubfknf$2plvs$1@dont-email.me> <ubfu4d$2r98d$1@dont-email.me>
<ubg4jr$2se4o$1@dont-email.me> <ubg7ku$2srfk$1@dont-email.me>
<ubgdr5$2tro0$1@dont-email.me> <ubgpip$2vk5e$1@dont-email.me>
<ubgulr$3095n$1@dont-email.me> <87pm3nlxuu.fsf@nosuchdomain.example.com>
<ubh3s8$30v7t$1@dont-email.me> <ubi5do$38ii5$1@dont-email.me>
<ubib54$39aqa$1@dont-email.me> <ubii7m$3acds$1@dont-email.me>
<ubivp8$3cjsl$1@dont-email.me> <ubl89c$3prfv$1@dont-email.me>
<ubma81$3upnp$1@dont-email.me> <20230817183700.915@kylheku.com>
<011f0102-1241-464c-b628-0350c0be29fbn@googlegroups.com> <87cyzjx4ob.fsf@bsb.me.uk>
<66629235-f2e0-46e0-bcb1-bf3abe1e33cdn@googlegroups.com> <nv76rj-6r2.ln1@spanky.localhost.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <94380001-0115-4e3e-9274-168d3e3a9573n@googlegroups.com>
Subject: Re: Build Systems
From: bart4...@gmail.com (bart c)
Injection-Date: Sat, 19 Aug 2023 16:54:50 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 6045
 by: bart c - Sat, 19 Aug 2023 16:54 UTC

On Saturday, 19 August 2023 at 17:03:41 UTC+1, Kelsey Bjarnason wrote:
> On Fri, 18 Aug 2023 18:36:51 -0700 (PDT), bart c wrote:
>
> > On Saturday, 19 August 2023 at 01:21:58 UTC+1, Ben Bacarisse wrote:
> >> bart c <bart...@gmail.com> writes:
> >
> >> > That is, you want to be able to type:
> >> >
> >> > X
> >> >
> >> > and not:
> >> >
> >> > X Y
> >> No, I want to type
> >>
> >> make make tests make install make clean make mylib.a
> >
> > I'm not familiar with how make is used. Do you routinely have to invoke
> > it five times in succession? Maybe that's a deeper problem with it, but
> > as I said I don't use it.
> >
> >> depending on what I'm doing rather than
> >>
> >> make makefile make makefile tests make makefile install make makefile
> >> clean make makefile mylib.a
> >
> > And this actually tells me that the main input is identical in all
> > cases; I'd been wondering what was being done with mylib.a. But whatever
> > it is, the same makefile that does all the other stuff contains some
> > formula for 'mylib.a'?
> >
> > In practice I doubt you would type this five times as normally you'd do
> > line recall then change the last bit. You can also choose to give it a
> > shorter name than 'makefile'!
> No, normally you'd do something like:
>
> make && make tests && make install && make clean && make mylib.a

If only there was a way of scripting that...

Obviously you can't use make and a makefile, since for one thing, 'makefile' has already been used, and using any other name is apparently a no-no.

> Then get a coffee while it does all of these in succession.

I wonder what it is about the stuff I do then I've never had any build process that took long enough to make and consume a cup of coffee. No even when working on machines 1000 times slower than they are now.

> >> What's more, tab completion in my shell works with make's targets, but

> > The rules on Windows can be simple: if there is no extension (no dot in
> > the name), then a default extension is added. It's harder with a Linux
> > file system because files "abc" and "abc." are distinct; how to do apply
> > a default extension to "abc" when that could be a valid filename?

> One might think you don't; if I tell a compiler to compile "file", I would
> expect it to compile "file", not "file.c" or "file.cpp" or "file.asm".

On Windows, "file" and "file." are the same file. So you can omit the extension /and/ period to mean the extension is unspecified. That leaves the app free to apply sensible defaults if the numbers of file types it deals with are restricted.

> If
> it can't determine the language other than by file extension, then it's up
> to me to ensure the files have the proper extension, and I tell it which
> to compile. Using your sort of examples, I might have file.c, file.cpp
> and file.asm in the directory - which one is it supposed to choose if I
> tell it to just compile "file"?

You have one tool that compiles C code, or C++, or ASM files? That's called making a rod for your own back. This is my point about gcc.

However, what input files does the 'as' assembler normally deal with? Isn't it just '.s' files? So that'd be an easy one to guess, would it not?

My own assembler is called 'aa':

aa x y z

this assembles files x.asm, y.asm and z.asm, and writes x.exe. I prefer writing that to:

aa x.asm y.asm z.asm -ox.exe

I'm funny that way.

> You don't need to specify -oprog if you don't want; you just wind up with
> a.out instead of prog as the result. Entirely up to you.

Well, obviously I don't want. Nobody does, except that's what they're told they're going to get, and being lazy bastards like most people (and like me), they don't bother overriding. But then they have to deal with a.out. Or, on Windows (where really, they could have fixed it as there was no prior art), a.exe.

Re: Build Systems

<20230819110026.903@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27940&group=comp.lang.c#27940

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c
Subject: Re: Build Systems
Date: Sat, 19 Aug 2023 18:16:19 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 81
Message-ID: <20230819110026.903@kylheku.com>
References: <uban99$1rnpb$1@dont-email.me> <ubgpip$2vk5e$1@dont-email.me>
<ubgulr$3095n$1@dont-email.me> <87pm3nlxuu.fsf@nosuchdomain.example.com>
<ubh3s8$30v7t$1@dont-email.me> <ubi5do$38ii5$1@dont-email.me>
<ubib54$39aqa$1@dont-email.me> <ubii7m$3acds$1@dont-email.me>
<ubivp8$3cjsl$1@dont-email.me> <ubl89c$3prfv$1@dont-email.me>
<ubma81$3upnp$1@dont-email.me> <20230817183700.915@kylheku.com>
<011f0102-1241-464c-b628-0350c0be29fbn@googlegroups.com>
<87cyzjx4ob.fsf@bsb.me.uk> <Hx4EM.686038$TPw2.217661@fx17.iad>
<db175a13-352a-461b-88e4-d37e14d1a6e2n@googlegroups.com>
<20230819085418.391@kylheku.com>
<45028397-a7aa-4243-afa3-2751a6d5ef8en@googlegroups.com>
Injection-Date: Sat, 19 Aug 2023 18:16:19 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="588828d29d125ee26b6c8f373c219d7a";
logging-data="1028198"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/BMmZVHurp+2rfmYBt+vxnlNwY6aBiIck="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:4HqAsN41Ytco8417gfSK8J8cHKY=
 by: Kaz Kylheku - Sat, 19 Aug 2023 18:16 UTC

On 2023-08-19, bart c <bart4858@gmail.com> wrote:
> On Saturday, 19 August 2023 at 16:59:16 UTC+1, Kaz Kylheku wrote:
>> On 2023-08-19, bart c <bart...@gmail.com> wrote:
>> > On Saturday, 19 August 2023 at 15:43:02 UTC+1, Scott Lurndal wrote:
>> >> Ben Bacarisse <ben.u...@bsb.me.uk> writes:
>> >> >bart c <bart...@gmail.com> writes:
>> >> >
>> >>
>> >> >>
>> >> >> on those other programs is anathema.
>> >> >
>> >> >Well (if you are talking about having to say gcc prog.c rather than gcc
>> >> >prog) there are advantages, and none of them have anything to do with
>> >> >how much one has to type. After all, command completion means I rarely
>> >> >type a file name explcitly anyway.
>> >> >
>> >> It's worth repeating that 'gcc' is a driver program, not a compiler.
>> >>
>> >> So:
>> >>
>> >> $ gcc -c -o a.o a.s
>> >>
>> >> is a perfectly legal and viable way to invoke the assembler.
>> >>
>> >> $ gcc -o a a.o
>> >>
>> >> is a perfectly legal and viable way to invoke the linker.
>> >
>> > You can run the assembler directly using 'as', and the linker using 'ld'.
>> Not reliably. The gcc driver is configured to use a particular
>> assembler, not necessarily the one found in you PATH under the
>> name "as".
>>
>> You might have an "as" that came from your Unix vendor, but gcc
>> was built with the GNU assembler.
>>
>> You could have different installations of gcc with different
>> versions of an assembler.
>> > So how do you directly invoke the actual C compiler?
>> That's an executable usually called cc1. You have to know where
>> that is. Even if gcc is in your PATH, cc1 won't be.
>
> I found cc1, but how do you use it? There's no conventional CLI. You can do:
>
> cc1 <hello.c

I don't think it's documented for use.

If you want to see what arguments are being passed to cc1, you can
use the "strace" utility on Linux or similar syscall tracers elsewhere.

> I get the feeling it is not meant to be used from the command line like 'as' and 'ld'.
>
> So, there /is/ no proper C-specific compiler with a normal interface; we're stuck with that driver.

That's correct.

Let's try:

$ strace -s 4096 -o gcc.log -f gcc foo.c -o foo
$ grep cc1 gcc.log
25364 stat64("/usr/lib/gcc/i686-linux-gnu/7/cc1", {st_mode=S_IFREG|0755, st_size=22895720, ...}) = 0
25364 access("/usr/lib/gcc/i686-linux-gnu/7/cc1", X_OK) = 0
25365 execve("/usr/lib/gcc/i686-linux-gnu/7/cc1", ["/usr/lib/gcc/i686-linux-gnu/7/cc1", "-quiet", "-imultiarch", "i386-linux-gnu", "foo.c", "-quiet", "-dumpbase", "foo.c", "-mtune=generic", "-march=i686", "-auxbase", "foo", "-fstack-protector-strong", "-Wformat", "-Wformat-security", "-o", "/tmp/ccKrG8uQ.s"], 0x8cad030 /* 62 vars */ <unfinished ...>

Looks like cc1 isn't being given a huge number of many options.

cc1 must be doing the preprocessing since it's getting foo.c as
input. I don't see any arguments which would tell it where the header
files are, so it must be getting that configuration in some
other ways. (I looked into the environment with strace -v too;
didn't see it.)

There is also another intermediary program called "collect2" which I
think handles the details of linking. In the above trace, there is an
invocation of collect2 after cc1.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: Build Systems

<slrnue24s9.guj.ike@iceland.freeshell.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27941&group=comp.lang.c#27941

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!rocksolid2!news.neodome.net!weretis.net!feeder8.news.weretis.net!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ike...@sdf.org (Ike Naar)
Newsgroups: comp.lang.c
Subject: Re: Build Systems
Date: Sat, 19 Aug 2023 19:10:02 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <slrnue24s9.guj.ike@iceland.freeshell.org>
References: <uban99$1rnpb$1@dont-email.me> <ubgpip$2vk5e$1@dont-email.me>
<ubgulr$3095n$1@dont-email.me> <87pm3nlxuu.fsf@nosuchdomain.example.com>
<ubh3s8$30v7t$1@dont-email.me> <ubi5do$38ii5$1@dont-email.me>
<ubib54$39aqa$1@dont-email.me> <ubii7m$3acds$1@dont-email.me>
<ubivp8$3cjsl$1@dont-email.me> <ubl89c$3prfv$1@dont-email.me>
<ubma81$3upnp$1@dont-email.me> <20230817183700.915@kylheku.com>
<011f0102-1241-464c-b628-0350c0be29fbn@googlegroups.com>
<87cyzjx4ob.fsf@bsb.me.uk> <Hx4EM.686038$TPw2.217661@fx17.iad>
<db175a13-352a-461b-88e4-d37e14d1a6e2n@googlegroups.com>
Injection-Date: Sat, 19 Aug 2023 19:10:02 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="60e8e1640cc73b5a416ca4de4edf22d7";
logging-data="1043216"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+kxuaj1V9Gx4uDWEajNIOS"
User-Agent: slrn/1.0.3 (Patched for libcanlock3) (NetBSD)
Cancel-Lock: sha1:CCSa3B9iwxAYp3LCYn6Vqbv2qa8=
 by: Ike Naar - Sat, 19 Aug 2023 19:10 UTC

On 2023-08-19, bart c <bart4858@gmail.com> wrote:
> On Saturday, 19 August 2023 at 15:43:02 UTC+1, Scott Lurndal wrote:
>> Ben Bacarisse <ben.u...@bsb.me.uk> writes:
>>
>> $ gcc -c -o a.o a.s
>>
>> is a perfectly legal and viable way to invoke the assembler.
>>
>> $ gcc -o a a.o
>>
>> is a perfectly legal and viable way to invoke the linker.
>
> You can run the assembler directly using 'as', and the linker using 'ld'.
>
> So how do you directly invoke the actual C compiler?

Running gcc with the -v or --verbose option will show the substeps it invokes.

Re: Build Systems

<877cpqx28w.fsf@bsb.me.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27942&group=comp.lang.c#27942

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: Build Systems
Date: Sat, 19 Aug 2023 20:26:23 +0100
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <877cpqx28w.fsf@bsb.me.uk>
References: <uban99$1rnpb$1@dont-email.me> <ubgpip$2vk5e$1@dont-email.me>
<ubgulr$3095n$1@dont-email.me>
<87pm3nlxuu.fsf@nosuchdomain.example.com>
<ubh3s8$30v7t$1@dont-email.me> <ubi5do$38ii5$1@dont-email.me>
<ubib54$39aqa$1@dont-email.me> <ubii7m$3acds$1@dont-email.me>
<ubivp8$3cjsl$1@dont-email.me> <ubl89c$3prfv$1@dont-email.me>
<ubma81$3upnp$1@dont-email.me> <20230817183700.915@kylheku.com>
<011f0102-1241-464c-b628-0350c0be29fbn@googlegroups.com>
<87cyzjx4ob.fsf@bsb.me.uk> <Hx4EM.686038$TPw2.217661@fx17.iad>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="3fc15511aac7d6a52e9762e8994bb691";
logging-data="1045265"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19GcMc88hj8FWhLKEZKAnRMama7brWszZk="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:kYiwxuGXsLJnBTIECsVTFCESY4I=
sha1:ANA4leZZbVtzeBbwECFJ1XtcfhA=
X-BSB-Auth: 1.5d3dac80960de5cd328e.20230819202623BST.877cpqx28w.fsf@bsb.me.uk
 by: Ben Bacarisse - Sat, 19 Aug 2023 19:26 UTC

scott@slp53.sl.home (Scott Lurndal) writes:

> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>>bart c <bart4858@gmail.com> writes:
>>>
>>> on those other programs is anathema.
>>
>>Well (if you are talking about having to say gcc prog.c rather than gcc
>>prog) there are advantages, and none of them have anything to do with
>>how much one has to type. After all, command completion means I rarely
>>type a file name explcitly anyway.
>>
>
> It's worth repeating that 'gcc' is a driver program, not a compiler.
>
> So:
>
> $ gcc -c -o a.o a.s
>
> is a perfectly legal and viable way to invoke the assembler.

Yes. I assumed Bart would know this. It was implicit in my remark
about running "gcc prog.s", but it better to make it explicit.

--
Ben.

Re: Build Systems

<drh7rj-1ci.ln1@spanky.localhost.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27943&group=comp.lang.c#27943

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: kbjarna...@gmail.com (Kelsey Bjarnason)
Newsgroups: comp.lang.c
Subject: Re: Build Systems
Date: Sat, 19 Aug 2023 12:30:21 -0700
Organization: A noiseless patient Spider
Lines: 148
Message-ID: <drh7rj-1ci.ln1@spanky.localhost.net>
References: <uban99$1rnpb$1@dont-email.me> <12sCM.59051$m8Ke.22097@fx08.iad>
<ubdmk4$2dao7$1@dont-email.me> <ubfeqj$2oop4$1@dont-email.me>
<ubfknf$2plvs$1@dont-email.me> <ubfu4d$2r98d$1@dont-email.me>
<ubg4jr$2se4o$1@dont-email.me> <ubg7ku$2srfk$1@dont-email.me>
<ubgdr5$2tro0$1@dont-email.me> <ubgpip$2vk5e$1@dont-email.me>
<ubgulr$3095n$1@dont-email.me> <87pm3nlxuu.fsf@nosuchdomain.example.com>
<ubh3s8$30v7t$1@dont-email.me> <ubi5do$38ii5$1@dont-email.me>
<ubib54$39aqa$1@dont-email.me> <ubii7m$3acds$1@dont-email.me>
<ubivp8$3cjsl$1@dont-email.me> <ubl89c$3prfv$1@dont-email.me>
<ubma81$3upnp$1@dont-email.me> <20230817183700.915@kylheku.com>
<011f0102-1241-464c-b628-0350c0be29fbn@googlegroups.com>
<87cyzjx4ob.fsf@bsb.me.uk>
<66629235-f2e0-46e0-bcb1-bf3abe1e33cdn@googlegroups.com>
<nv76rj-6r2.ln1@spanky.localhost.net>
<94380001-0115-4e3e-9274-168d3e3a9573n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: dont-email.me; posting-host="6e7f951ddf49aa1da1fc945fcae855bf";
logging-data="1049875"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX181eG38kZVObTt+AQ8YjpHBL9fm2CDyPGs="
User-Agent: Pan/0.154 (Izium; 517acf4)
Cancel-Lock: sha1:n95QHQVvDXjYt3gU9hOYtq3ARfs=
 by: Kelsey Bjarnason - Sat, 19 Aug 2023 19:30 UTC

On Sat, 19 Aug 2023 09:54:49 -0700 (PDT), bart c wrote:

> On Saturday, 19 August 2023 at 17:03:41 UTC+1, Kelsey Bjarnason wrote:
>> On Fri, 18 Aug 2023 18:36:51 -0700 (PDT), bart c wrote:
>>
>> > On Saturday, 19 August 2023 at 01:21:58 UTC+1, Ben Bacarisse wrote:
>> >> bart c <bart...@gmail.com> writes:
>> >
>> >> > That is, you want to be able to type:
>> >> >
>> >> > X
>> >> >
>> >> > and not:
>> >> >
>> >> > X Y
>> >> No, I want to type
>> >>
>> >> make make tests make install make clean make mylib.a
>> >
>> > I'm not familiar with how make is used. Do you routinely have to
>> > invoke it five times in succession? Maybe that's a deeper problem
>> > with it, but as I said I don't use it.
>> >
>> >> depending on what I'm doing rather than
>> >>
>> >> make makefile make makefile tests make makefile install make
>> >> makefile clean make makefile mylib.a
>> >
>> > And this actually tells me that the main input is identical in all
>> > cases; I'd been wondering what was being done with mylib.a. But
>> > whatever it is, the same makefile that does all the other stuff
>> > contains some formula for 'mylib.a'?
>> >
>> > In practice I doubt you would type this five times as normally you'd
>> > do line recall then change the last bit. You can also choose to give
>> > it a shorter name than 'makefile'!
>> No, normally you'd do something like:
>>
>> make && make tests && make install && make clean && make mylib.a
>
> If only there was a way of scripting that...
>
> Obviously you can't use make and a makefile, since for one thing,
> 'makefile' has already been used, and using any other name is apparently
> a no-no.

That *would be* using a makefile. One with multiple targets. You just
specify which target you want to build, or use the default target which is
virtually always the relevant, expected output - library, executable,
whatever.

And why script something when a) it adds nothing of value, and b) you may
want to vary what gets built from run to run, so you just specify what you
want built instead of editing the script every time?

This is actually simpler than using a script.

>
>> Then get a coffee while it does all of these in succession.
>
> I wonder what it is about the stuff I do then I've never had any build
> process that took long enough to make and consume a cup of coffee. No
> even when working on machines 1000 times slower than they are now.

Depends on too many factors to evaluate here. I have code that's tens of
thousands of lines long and builds in a flash. I have other code that's
rather less lengthy and compiles much more slowly. Depends on code,
compiler, optimization settings, language involved, dependency resolution,
caching, too many things to evaluate unless one does a "clean" comparison
of the same code, the same optimization levels, etc.

>
>> >> What's more, tab completion in my shell works with make's targets,
>> >> but
>
>> > The rules on Windows can be simple: if there is no extension (no dot
>> > in the name), then a default extension is added. It's harder with a
>> > Linux file system because files "abc" and "abc." are distinct; how to
>> > do apply a default extension to "abc" when that could be a valid
>> > filename?
>
>> One might think you don't; if I tell a compiler to compile "file", I
>> would expect it to compile "file", not "file.c" or "file.cpp" or
>> "file.asm".
>
> On Windows, "file" and "file." are the same file. So you can omit the
> extension /and/ period to mean the extension is unspecified. That leaves
> the app free to apply sensible defaults if the numbers of file types it
> deals with are restricted.
>
>
>> If it can't determine the language other than by file extension, then
>> it's up to me to ensure the files have the proper extension, and I tell
>> it which to compile. Using your sort of examples, I might have file.c,
>> file.cpp and file.asm in the directory - which one is it supposed to
>> choose if I tell it to just compile "file"?
>
> You have one tool that compiles C code, or C++, or ASM files? That's
> called making a rod for your own back. This is my point about gcc.

Last I checked. most of the Windows compilers would happily compile C and
C++ files, based on extension. So when I say "compile file", do I mean
file.c or file.cpp?

> However, what input files does the 'as' assembler normally deal with?
> Isn't it just '.s' files? So that'd be an easy one to guess, would it
> not?
>
> My own assembler is called 'aa':
>
> aa x y z
>
> this assembles files x.asm, y.asm and z.asm, and writes x.exe. I prefer
> writing that to:
>
> aa x.asm y.asm z.asm -ox.exe
>
> I'm funny that way.

Indeed. I'd rather just write "make" and have it all be done, complete
with ensuring any out of date intermediate files are properly generated
first. It's shorter to write, and it takes care of unintentional
oversights.

>
>
>> You don't need to specify -oprog if you don't want; you just wind up
>> with a.out instead of prog as the result. Entirely up to you.
>
> Well, obviously I don't want. Nobody does, except that's what they're
> told they're going to get, and being lazy bastards like most people (and
> like me), they don't bother overriding. But then they have to deal with
> a.out. Or, on Windows (where really, they could have fixed it as there
> was no prior art), a.exe.

Okay, so you get a.out/a.exe. And? By your logic above, that's
preferable to, say, "myprogram.exe" - less typing.

So here you want *more* typing, but up there you want less, despite
arguing against using the optioon with both the *least* typing and the
most output correctness assurance.

You should really pick one side of whatever you're arguing for and stick
with that; arguing both sides is just silly.

Re: Build Systems

<4d9cd1b8-1323-46c8-947b-5b8481a5b2cdn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27946&group=comp.lang.c#27946

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ae9:f70e:0:b0:76c:81dc:afee with SMTP id s14-20020ae9f70e000000b0076c81dcafeemr13431qkg.12.1692477869662;
Sat, 19 Aug 2023 13:44:29 -0700 (PDT)
X-Received: by 2002:a17:902:ea0d:b0:1bd:da96:dc74 with SMTP id
s13-20020a170902ea0d00b001bdda96dc74mr1329290plg.6.1692477869309; Sat, 19 Aug
2023 13:44:29 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 19 Aug 2023 13:44:28 -0700 (PDT)
In-Reply-To: <drh7rj-1ci.ln1@spanky.localhost.net>
Injection-Info: google-groups.googlegroups.com; posting-host=94.175.38.125; posting-account=rqC7UgoAAACeVvrGykivrxfPIl3bA_1y
NNTP-Posting-Host: 94.175.38.125
References: <uban99$1rnpb$1@dont-email.me> <12sCM.59051$m8Ke.22097@fx08.iad>
<ubdmk4$2dao7$1@dont-email.me> <ubfeqj$2oop4$1@dont-email.me>
<ubfknf$2plvs$1@dont-email.me> <ubfu4d$2r98d$1@dont-email.me>
<ubg4jr$2se4o$1@dont-email.me> <ubg7ku$2srfk$1@dont-email.me>
<ubgdr5$2tro0$1@dont-email.me> <ubgpip$2vk5e$1@dont-email.me>
<ubgulr$3095n$1@dont-email.me> <87pm3nlxuu.fsf@nosuchdomain.example.com>
<ubh3s8$30v7t$1@dont-email.me> <ubi5do$38ii5$1@dont-email.me>
<ubib54$39aqa$1@dont-email.me> <ubii7m$3acds$1@dont-email.me>
<ubivp8$3cjsl$1@dont-email.me> <ubl89c$3prfv$1@dont-email.me>
<ubma81$3upnp$1@dont-email.me> <20230817183700.915@kylheku.com>
<011f0102-1241-464c-b628-0350c0be29fbn@googlegroups.com> <87cyzjx4ob.fsf@bsb.me.uk>
<66629235-f2e0-46e0-bcb1-bf3abe1e33cdn@googlegroups.com> <nv76rj-6r2.ln1@spanky.localhost.net>
<94380001-0115-4e3e-9274-168d3e3a9573n@googlegroups.com> <drh7rj-1ci.ln1@spanky.localhost.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4d9cd1b8-1323-46c8-947b-5b8481a5b2cdn@googlegroups.com>
Subject: Re: Build Systems
From: bart4...@gmail.com (bart c)
Injection-Date: Sat, 19 Aug 2023 20:44:29 +0000
Content-Type: text/plain; charset="UTF-8"
 by: bart c - Sat, 19 Aug 2023 20:44 UTC

On Saturday, 19 August 2023 at 20:35:53 UTC+1, Kelsey Bjarnason wrote:
> On Sat, 19 Aug 2023 09:54:49 -0700 (PDT), bart c wrote:
>
> > On Saturday, 19 August 2023 at 17:03:41 UTC+1, Kelsey Bjarnason wrote:
> >> On Fri, 18 Aug 2023 18:36:51 -0700 (PDT), bart c wrote:
> >>
> >> > On Saturday, 19 August 2023 at 01:21:58 UTC+1, Ben Bacarisse wrote:
> >> >> bart c <bart...@gmail.com> writes:
> >> >
> >> >> > That is, you want to be able to type:
> >> >> >
> >> >> > X
> >> >> >
> >> >> > and not:
> >> >> >
> >> >> > X Y
> >> >> No, I want to type
> >> >>
> >> >> make make tests make install make clean make mylib.a
> >> >
> >> > I'm not familiar with how make is used. Do you routinely have to
> >> > invoke it five times in succession? Maybe that's a deeper problem
> >> > with it, but as I said I don't use it.
> >> >
> >> >> depending on what I'm doing rather than
> >> >>
> >> >> make makefile make makefile tests make makefile install make
> >> >> makefile clean make makefile mylib.a
> >> >
> >> > And this actually tells me that the main input is identical in all
> >> > cases; I'd been wondering what was being done with mylib.a. But
> >> > whatever it is, the same makefile that does all the other stuff
> >> > contains some formula for 'mylib.a'?
> >> >
> >> > In practice I doubt you would type this five times as normally you'd
> >> > do line recall then change the last bit. You can also choose to give
> >> > it a shorter name than 'makefile'!
> >> No, normally you'd do something like:
> >>
> >> make && make tests && make install && make clean && make mylib.a
> >
> > If only there was a way of scripting that...
> >
> > Obviously you can't use make and a makefile, since for one thing,
> > 'makefile' has already been used, and using any other name is apparently
> > a no-no.
> That *would be* using a makefile. One with multiple targets. You just
> specify which target you want to build, or use the default target which is
> virtually always the relevant, expected output - library, executable,
> whatever.
>
> And why script something when a) it adds nothing of value, and b) you may
> want to vary what gets built from run to run, so you just specify what you
> want built instead of editing the script every time?

Exactly. Doing ad hoc stuff like this:

bcc prog
prog
tcc proc.c
prog
gcc prog.c
a (gcc just HAS to be different!)
gcc prog.c -O3
a

Is easier than messing about with makefiles. But you seem to be under the impression that using a makefile isn't running a script. I don't get it.

Show me how you're do those 4 compilations using make, without a specially written make script.

> > I wonder what it is about the stuff I do then I've never had any build
> > process that took long enough to make and consume a cup of coffee. No
> > even when working on machines 1000 times slower than they are now.
> Depends on too many factors to evaluate here. I have code that's tens of
> thousands of lines long and builds in a flash. I have other code that's
> rather less lengthy and compiles much more slowly. Depends on code,
> compiler, optimization settings, language involved, dependency resolution,
> caching, too many things to evaluate unless one does a "clean" comparison
> of the same code, the same optimization levels, etc.

Has it ever take long enough to /enjoy/ drinking a coffee?

Unfortunately, since most of my stuff builds in 0.1 seconds, it will have finished doing so as soon as I've released the Enter key. Back to work!

> > My own assembler is called 'aa':
> >
> > aa x y z
> >
> > this assembles files x.asm, y.asm and z.asm, and writes x.exe. I prefer
> > writing that to:
> >
> > aa x.asm y.asm z.asm -ox.exe
> >
> > I'm funny that way.

> Indeed. I'd rather just write "make" and have it all be done, complete
> with ensuring any out of date intermediate files are properly generated
> first. It's shorter to write, and it takes care of unintentional
> oversights.

That's scripting! I can just stick that line in a make.bat file and then type:

make

But I don't normally work from the command line except for ad hoc invocations with variable options as already explained. Scripting here works poorly.

> You should really pick one side of whatever you're arguing for and stick
> with that; arguing both sides is just silly.

It's the way that your tools work that is silly, since the direct tools are too verbose, and make is scarily not verbose enough.

On the one hand you have to do:

gcc main.c a.c b.c -omain

On the other, you want to just do:

make

which ... does what? All that stuff is put inside 'makefile' in a form which is even more verbose since it will split it up into dependencies between .c, .h and .o files.

But, now instead of your project being defined as THREE source files, ONE tool and ONE language: {main + a + b, gcc, C}, it is defined as FOUR source files, TWO tools and TWO languages:

{main + a + b + makefile, gcc + make, C + make-syntax}

There is no happy medium such as is used by my product:

bcc main a b
bcc -auto main # using automatic module discovery with a suitably structured project.

In that second example, the project is defined (ie. can be fully described to the build process) as ONE source file, ONE tool and ONE language: {main, bcc, C}

Now, people like David Brown will try and argue that using 'make' like this:

make

The project is also defined as ONE source file, ONE tool, and ONE language: {makefile, make, make-syntax}. Or possibly even as ONE tool and ONE language since the implicit 'makefile' doesn't have to figure in it.

You can believe that if you want. If so, try deleting the C compiler and see if it still builds.

Re: Build Systems

<a4aEM.562364$SuUf.473875@fx14.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27948&group=comp.lang.c#27948

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.1d4.us!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx14.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Build Systems
Newsgroups: comp.lang.c
References: <uban99$1rnpb$1@dont-email.me> <ubh3s8$30v7t$1@dont-email.me> <ubi5do$38ii5$1@dont-email.me> <ubib54$39aqa$1@dont-email.me> <ubii7m$3acds$1@dont-email.me> <ubivp8$3cjsl$1@dont-email.me> <ubl89c$3prfv$1@dont-email.me> <ubma81$3upnp$1@dont-email.me> <20230817183700.915@kylheku.com> <011f0102-1241-464c-b628-0350c0be29fbn@googlegroups.com> <87cyzjx4ob.fsf@bsb.me.uk> <Hx4EM.686038$TPw2.217661@fx17.iad> <db175a13-352a-461b-88e4-d37e14d1a6e2n@googlegroups.com>
Lines: 39
Message-ID: <a4aEM.562364$SuUf.473875@fx14.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Sat, 19 Aug 2023 21:00:54 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Sat, 19 Aug 2023 21:00:54 GMT
X-Received-Bytes: 2020
 by: Scott Lurndal - Sat, 19 Aug 2023 21:00 UTC

bart c <bart4858@gmail.com> writes:
>On Saturday, 19 August 2023 at 15:43:02 UTC+1, Scott Lurndal wrote:
>> Ben Bacarisse <ben.u...@bsb.me.uk> writes:
>> >bart c <bart...@gmail.com> writes:
>> >
>>
>> >>
>> >> on those other programs is anathema.
>> >
>> >Well (if you are talking about having to say gcc prog.c rather than gcc
>> >prog) there are advantages, and none of them have anything to do with
>> >how much one has to type. After all, command completion means I rarely
>> >type a file name explcitly anyway.
>> >
>> It's worth repeating that 'gcc' is a driver program, not a compiler.
>>
>> So:
>>
>> $ gcc -c -o a.o a.s
>>
>> is a perfectly legal and viable way to invoke the assembler.
>>
>> $ gcc -o a a.o
>>
>> is a perfectly legal and viable way to invoke the linker.
>
>You can run the assembler directly using 'as', and the linker using 'ld'.
>
>So how do you directly invoke the actual C compiler?

As if you don't already know.

$ gcc -o a.o a.c

or

$ gcc -o a a.c

Re: Build Systems

<B5aEM.562365$SuUf.252005@fx14.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27949&group=comp.lang.c#27949

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx14.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Build Systems
Newsgroups: comp.lang.c
References: <uban99$1rnpb$1@dont-email.me> <ubii7m$3acds$1@dont-email.me> <ubivp8$3cjsl$1@dont-email.me> <ubl89c$3prfv$1@dont-email.me> <ubma81$3upnp$1@dont-email.me> <20230817183700.915@kylheku.com> <011f0102-1241-464c-b628-0350c0be29fbn@googlegroups.com> <87cyzjx4ob.fsf@bsb.me.uk> <Hx4EM.686038$TPw2.217661@fx17.iad> <db175a13-352a-461b-88e4-d37e14d1a6e2n@googlegroups.com> <20230819085418.391@kylheku.com> <45028397-a7aa-4243-afa3-2751a6d5ef8en@googlegroups.com> <20230819110026.903@kylheku.com>
Lines: 79
Message-ID: <B5aEM.562365$SuUf.252005@fx14.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Sat, 19 Aug 2023 21:02:25 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Sat, 19 Aug 2023 21:02:25 GMT
X-Received-Bytes: 4482
 by: Scott Lurndal - Sat, 19 Aug 2023 21:02 UTC

Kaz Kylheku <864-117-4973@kylheku.com> writes:
>On 2023-08-19, bart c <bart4858@gmail.com> wrote:
>> On Saturday, 19 August 2023 at 16:59:16 UTC+1, Kaz Kylheku wrote:
>>> On 2023-08-19, bart c <bart...@gmail.com> wrote:
>>> > On Saturday, 19 August 2023 at 15:43:02 UTC+1, Scott Lurndal wrote:
>>> >> Ben Bacarisse <ben.u...@bsb.me.uk> writes:
>>> >> >bart c <bart...@gmail.com> writes:
>>> >> >
>>> >>
>>> >> >>
>>> >> >> on those other programs is anathema.
>>> >> >
>>> >> >Well (if you are talking about having to say gcc prog.c rather than gcc
>>> >> >prog) there are advantages, and none of them have anything to do with
>>> >> >how much one has to type. After all, command completion means I rarely
>>> >> >type a file name explcitly anyway.
>>> >> >
>>> >> It's worth repeating that 'gcc' is a driver program, not a compiler.
>>> >>
>>> >> So:
>>> >>
>>> >> $ gcc -c -o a.o a.s
>>> >>
>>> >> is a perfectly legal and viable way to invoke the assembler.
>>> >>
>>> >> $ gcc -o a a.o
>>> >>
>>> >> is a perfectly legal and viable way to invoke the linker.
>>> >
>>> > You can run the assembler directly using 'as', and the linker using 'ld'.
>>> Not reliably. The gcc driver is configured to use a particular
>>> assembler, not necessarily the one found in you PATH under the
>>> name "as".
>>>
>>> You might have an "as" that came from your Unix vendor, but gcc
>>> was built with the GNU assembler.
>>>
>>> You could have different installations of gcc with different
>>> versions of an assembler.
>>> > So how do you directly invoke the actual C compiler?
>>> That's an executable usually called cc1. You have to know where
>>> that is. Even if gcc is in your PATH, cc1 won't be.
>>
>> I found cc1, but how do you use it? There's no conventional CLI. You can do:
>>
>> cc1 <hello.c
>
>I don't think it's documented for use.
>
>If you want to see what arguments are being passed to cc1, you can
>use the "strace" utility on Linux or similar syscall tracers elsewhere.
>
>> I get the feeling it is not meant to be used from the command line like 'as' and 'ld'.
>>
>> So, there /is/ no proper C-specific compiler with a normal interface; we're stuck with that driver.
>
>That's correct.
>
>Let's try:
>
>$ strace -s 4096 -o gcc.log -f gcc foo.c -o foo
>$ grep cc1 gcc.log
>25364 stat64("/usr/lib/gcc/i686-linux-gnu/7/cc1", {st_mode=S_IFREG|0755, st_size=22895720, ...}) = 0
>25364 access("/usr/lib/gcc/i686-linux-gnu/7/cc1", X_OK) = 0
>25365 execve("/usr/lib/gcc/i686-linux-gnu/7/cc1", ["/usr/lib/gcc/i686-linux-gnu/7/cc1", "-quiet", "-imultiarch", "i386-linux-gnu", "foo.c", "-quiet", "-dumpbase", "foo.c", "-mtune=generic", "-march=i686", "-auxbase", "foo", "-fstack-protector-strong", "-Wformat", "-Wformat-security", "-o", "/tmp/ccKrG8uQ.s"], 0x8cad030 /* 62 vars */ <unfinished ...>
>
>Looks like cc1 isn't being given a huge number of many options.
>
>cc1 must be doing the preprocessing since it's getting foo.c as
>input. I don't see any arguments which would tell it where the header
>files are, so it must be getting that configuration in some
>other ways. (I looked into the environment with strace -v too;
>didn't see it.)
>
>There is also another intermediary program called "collect2" which I
>think handles the details of linking. In the above trace, there is an
>invocation of collect2 after cc1.

IIRC collect is the optimization pass.

Re: Build Systems

<87h6ouivl8.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27952&group=comp.lang.c#27952

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: Build Systems
Date: Sat, 19 Aug 2023 14:13:55 -0700
Organization: None to speak of
Lines: 11
Message-ID: <87h6ouivl8.fsf@nosuchdomain.example.com>
References: <uban99$1rnpb$1@dont-email.me> <ubgpip$2vk5e$1@dont-email.me>
<ubgulr$3095n$1@dont-email.me>
<87pm3nlxuu.fsf@nosuchdomain.example.com>
<ubh3s8$30v7t$1@dont-email.me> <ubi5do$38ii5$1@dont-email.me>
<ubib54$39aqa$1@dont-email.me> <ubii7m$3acds$1@dont-email.me>
<ubivp8$3cjsl$1@dont-email.me> <ubl89c$3prfv$1@dont-email.me>
<ubma81$3upnp$1@dont-email.me> <20230817183700.915@kylheku.com>
<011f0102-1241-464c-b628-0350c0be29fbn@googlegroups.com>
<87cyzjx4ob.fsf@bsb.me.uk> <Hx4EM.686038$TPw2.217661@fx17.iad>
<db175a13-352a-461b-88e4-d37e14d1a6e2n@googlegroups.com>
<20230819085418.391@kylheku.com>
<45028397-a7aa-4243-afa3-2751a6d5ef8en@googlegroups.com>
<20230819110026.903@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="1e04a54e3bb4357616ae504e49c638ae";
logging-data="1068971"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19IqV5ceTAZPYiI8UyuzTD0"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:sLugABQUhqyLjTWZ7CFqkBDLVn0=
sha1:B1z4rEKdh6w5e6q4utj/zeF9oOs=
 by: Keith Thompson - Sat, 19 Aug 2023 21:13 UTC

Kaz Kylheku <864-117-4973@kylheku.com> writes:
[...]
> If you want to see what arguments are being passed to cc1, you can
> use the "strace" utility on Linux or similar syscall tracers elsewhere.

"gcc -v" shows the invoked programs and arguments.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

Re: Build Systems

<43c6a219-ad2c-4df7-8fdf-ec6c9aa54ad3n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27953&group=comp.lang.c#27953

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:b34:b0:63c:f602:f1d9 with SMTP id w20-20020a0562140b3400b0063cf602f1d9mr16391qvj.8.1692480177847;
Sat, 19 Aug 2023 14:22:57 -0700 (PDT)
X-Received: by 2002:a17:902:ea0d:b0:1bb:1a64:5a70 with SMTP id
s13-20020a170902ea0d00b001bb1a645a70mr1622082plg.11.1692480177096; Sat, 19
Aug 2023 14:22:57 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 19 Aug 2023 14:22:56 -0700 (PDT)
In-Reply-To: <a4aEM.562364$SuUf.473875@fx14.iad>
Injection-Info: google-groups.googlegroups.com; posting-host=94.175.38.125; posting-account=rqC7UgoAAACeVvrGykivrxfPIl3bA_1y
NNTP-Posting-Host: 94.175.38.125
References: <uban99$1rnpb$1@dont-email.me> <ubh3s8$30v7t$1@dont-email.me>
<ubi5do$38ii5$1@dont-email.me> <ubib54$39aqa$1@dont-email.me>
<ubii7m$3acds$1@dont-email.me> <ubivp8$3cjsl$1@dont-email.me>
<ubl89c$3prfv$1@dont-email.me> <ubma81$3upnp$1@dont-email.me>
<20230817183700.915@kylheku.com> <011f0102-1241-464c-b628-0350c0be29fbn@googlegroups.com>
<87cyzjx4ob.fsf@bsb.me.uk> <Hx4EM.686038$TPw2.217661@fx17.iad>
<db175a13-352a-461b-88e4-d37e14d1a6e2n@googlegroups.com> <a4aEM.562364$SuUf.473875@fx14.iad>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <43c6a219-ad2c-4df7-8fdf-ec6c9aa54ad3n@googlegroups.com>
Subject: Re: Build Systems
From: bart4...@gmail.com (bart c)
Injection-Date: Sat, 19 Aug 2023 21:22:57 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3260
 by: bart c - Sat, 19 Aug 2023 21:22 UTC

On Saturday, 19 August 2023 at 22:01:09 UTC+1, Scott Lurndal wrote:
> bart c <bart...@gmail.com> writes:
> >On Saturday, 19 August 2023 at 15:43:02 UTC+1, Scott Lurndal wrote:
> >> Ben Bacarisse <ben.u...@bsb.me.uk> writes:
> >> >bart c <bart...@gmail.com> writes:
> >> >
> >>
> >> >>
> >> >> on those other programs is anathema.
> >> >
> >> >Well (if you are talking about having to say gcc prog.c rather than gcc
> >> >prog) there are advantages, and none of them have anything to do with
> >> >how much one has to type. After all, command completion means I rarely
> >> >type a file name explcitly anyway.
> >> >
> >> It's worth repeating that 'gcc' is a driver program, not a compiler.
> >>
> >> So:
> >>
> >> $ gcc -c -o a.o a.s
> >>
> >> is a perfectly legal and viable way to invoke the assembler.
> >>
> >> $ gcc -o a a.o
> >>
> >> is a perfectly legal and viable way to invoke the linker.
> >
> >You can run the assembler directly using 'as', and the linker using 'ld'..
> >
> >So how do you directly invoke the actual C compiler?
> As if you don't already know.
>
> $ gcc -o a.o a.c
>
> or
>
> $ gcc -o a a.c

I thought you said gcc was the driver program?

I wonder why there has to be such a big mystery about gcc (like, is it an actual compiler), why it has to work that way, or why everything to do with building C has to revolve around how Unix and gcc (and cc before that) work.. Is it all decreed in the C standard?

If I do this:

pico hello.c

the process is entirely different. But it's still C.

Re: Build Systems

<87edjyvdba.fsf@bsb.me.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27955&group=comp.lang.c#27955

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: Build Systems
Date: Sun, 20 Aug 2023 00:10:17 +0100
Organization: A noiseless patient Spider
Lines: 118
Message-ID: <87edjyvdba.fsf@bsb.me.uk>
References: <uban99$1rnpb$1@dont-email.me> <ubfeqj$2oop4$1@dont-email.me>
<ubfknf$2plvs$1@dont-email.me> <ubfu4d$2r98d$1@dont-email.me>
<ubg4jr$2se4o$1@dont-email.me> <ubg7ku$2srfk$1@dont-email.me>
<ubgdr5$2tro0$1@dont-email.me> <ubgpip$2vk5e$1@dont-email.me>
<ubgulr$3095n$1@dont-email.me>
<87pm3nlxuu.fsf@nosuchdomain.example.com>
<ubh3s8$30v7t$1@dont-email.me> <ubi5do$38ii5$1@dont-email.me>
<ubib54$39aqa$1@dont-email.me> <ubii7m$3acds$1@dont-email.me>
<ubivp8$3cjsl$1@dont-email.me> <ubl89c$3prfv$1@dont-email.me>
<ubma81$3upnp$1@dont-email.me> <20230817183700.915@kylheku.com>
<011f0102-1241-464c-b628-0350c0be29fbn@googlegroups.com>
<87cyzjx4ob.fsf@bsb.me.uk>
<66629235-f2e0-46e0-bcb1-bf3abe1e33cdn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="e5d8f68d80d0d28048106bb566360eff";
logging-data="1105918"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18uI9T/BlCI02LKYvwyztt5DGHq80IUNwU="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:W/H0LvNmkHQ6RhmRHI4LgzVJ4o0=
sha1:yAB2AlTLMA232+FZTDldHxeIwbs=
X-BSB-Auth: 1.7661ccd216f1884ae53e.20230820001017BST.87edjyvdba.fsf@bsb.me.uk
 by: Ben Bacarisse - Sat, 19 Aug 2023 23:10 UTC

bart c <bart4858@gmail.com> writes:

> On Saturday, 19 August 2023 at 01:21:58 UTC+1, Ben Bacarisse wrote:
>> bart c <bart...@gmail.com> writes:
>
>> > That is, you want to be able to type:
>> >
>> > X
>> >
>> > and not:
>> >
>> > X Y
>> No, I want to type
>>
>> make
>> make tests
>> make install
>> make clean
>> make mylib.a
>
> I'm not familiar with how make is used.

You have very strong opinions about something you don't know much about.

> Do you routinely have to
> invoke it five times in succession?

No. I am giving typical example invocations.

> Maybe that's a deeper problem with
> it, but as I said I don't use it.

Obviously.

>> depending on what I'm doing rather than
>>
>> make makefile
>> make makefile tests
>> make makefile install
>> make makefile clean
>> make makefile mylib.a
>
> And this actually tells me that the main input is identical in all
> cases;

Yes, it's somewhat like a configuration file.

> I'd been wondering what was being done with mylib.a. But whatever it
> is, the same makefile that does all the other stuff contains some
> formula for 'mylib.a'?

Presumably.

> In practice I doubt you would type this five times as normally you'd
> do line recall then change the last bit.

Yes. I hope we can agree one thing: how much one types is almost
entirely irrelevant on modern systems. You kept going on about it, but
the typing has never been the issue.

> You can also choose to give it a shorter name than 'makefile'!

Yes, but the typing is not, and never has been, the issue. If the name
is not defaulted everyone has to guess where the rules for this project
are stored. And it's redundant and intrusive to keep specifying the
configuration, even if it's easy to type.

>> What's more, tab completion in my shell works with make's targets, but I
>> don't think that's at all easy to do if the makefile has to be named in
>> the same command.
>> > like nearly every other command line program.
>>
>> > Yet being able to do
>> >
>> > X Y
>> >
>> > instead of:
>> >
>> > X Y.Z
>> >
>> > on those other programs is anathema.
>> Well (if you are talking about having to say gcc prog.c rather than gcc
>> prog) there are advantages, and none of them have anything to do with
>> how much one has to type. After all, command completion means I rarely
>> type a file name explcitly anyway.
>
> If my C test folder, I had 23 files that started with
> 'hello'. Although they are stepped through in alphabetical order on
> Windows and .c is near the top, you still have to tentatively keep
> pressing tab, then you go too far and need shift-tab .. it is quicker
> just to type the extension! Better however not to have to bother.

As I say, it's not about saving two key presses, it's about:

>> The main advantage is that there's no need to specify and remember all
>> the rules. Does gcc always add .c? Will it add .c if I type gcc
>> prog.s? Must I avoid any dots in the basename? What happens when
>> several names appear on the command line?
>
> gcc is a bad example to follow since it does too much on the command
> line and performs multiple functions.

But it's what you were talking about. You seem to want it to do less.
I don't.

>> > It's fascinating watching psychology and group-think at work.
>>
>> As usual, you've invented a position (it'a all about the typing) and
>> argued about that instead of taking on board the actual comments that
>> people have made.
>
> The typing is part of it.

For you. Not for me. It seems you care enough about it to champion a
compiler driver that isn't very flexible. I don't.

--
Ben.

Re: Build Systems

<038f3d41-228f-4f22-9086-8596e9022057n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27956&group=comp.lang.c#27956

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:4791:b0:76d:7fca:df0a with SMTP id dt17-20020a05620a479100b0076d7fcadf0amr16211qkb.15.1692492657555;
Sat, 19 Aug 2023 17:50:57 -0700 (PDT)
X-Received: by 2002:a17:903:1011:b0:1bd:c6e9:e257 with SMTP id
a17-20020a170903101100b001bdc6e9e257mr265042plb.1.1692492657040; Sat, 19 Aug
2023 17:50:57 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 19 Aug 2023 17:50:56 -0700 (PDT)
In-Reply-To: <87edjyvdba.fsf@bsb.me.uk>
Injection-Info: google-groups.googlegroups.com; posting-host=94.175.38.125; posting-account=rqC7UgoAAACeVvrGykivrxfPIl3bA_1y
NNTP-Posting-Host: 94.175.38.125
References: <uban99$1rnpb$1@dont-email.me> <ubfeqj$2oop4$1@dont-email.me>
<ubfknf$2plvs$1@dont-email.me> <ubfu4d$2r98d$1@dont-email.me>
<ubg4jr$2se4o$1@dont-email.me> <ubg7ku$2srfk$1@dont-email.me>
<ubgdr5$2tro0$1@dont-email.me> <ubgpip$2vk5e$1@dont-email.me>
<ubgulr$3095n$1@dont-email.me> <87pm3nlxuu.fsf@nosuchdomain.example.com>
<ubh3s8$30v7t$1@dont-email.me> <ubi5do$38ii5$1@dont-email.me>
<ubib54$39aqa$1@dont-email.me> <ubii7m$3acds$1@dont-email.me>
<ubivp8$3cjsl$1@dont-email.me> <ubl89c$3prfv$1@dont-email.me>
<ubma81$3upnp$1@dont-email.me> <20230817183700.915@kylheku.com>
<011f0102-1241-464c-b628-0350c0be29fbn@googlegroups.com> <87cyzjx4ob.fsf@bsb.me.uk>
<66629235-f2e0-46e0-bcb1-bf3abe1e33cdn@googlegroups.com> <87edjyvdba.fsf@bsb.me.uk>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <038f3d41-228f-4f22-9086-8596e9022057n@googlegroups.com>
Subject: Re: Build Systems
From: bart4...@gmail.com (bart c)
Injection-Date: Sun, 20 Aug 2023 00:50:57 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 6350
 by: bart c - Sun, 20 Aug 2023 00:50 UTC

On Sunday, 20 August 2023 at 00:10:38 UTC+1, Ben Bacarisse wrote:
> bart c <bart...@gmail.com> writes:
> > On Saturday, 19 August 2023 at 01:21:58 UTC+1, Ben Bacarisse wrote:
> >> bart c <bart...@gmail.com> writes:
> >
> >> > That is, you want to be able to type:
> >> >
> >> > X
> >> >
> >> > and not:
> >> >
> >> > X Y
> >> No, I want to type
> >>
> >> make
> >> make tests
> >> make install
> >> make clean
> >> make mylib.a
> >
> > I'm not familiar with how make is used.
> You have very strong opinions about something you don't know much about.

Well, I'm being brow-beaten by so many people into using something I don't want to use. Or I'm obliged to use it in building open-source software (something I'm rapidly losing interest in).

I'm seen enough of it to know that I don't like it and it's not for me. Giving you case studies of all the cases where following the build rules generally results in failure seems to cut no ice; the problem can't possibly be a fragile and error prone process, people have to get personal.

The makefile syntax is obscure enough that if something goes wrong, I can't fix it. (I've suggested that a build-system for a one-off end-user build of a working product should use a streamlined process and a simpler makefile; that fell on deaf ears.)

Clearly some of you use 'make' for routine development. I don't; for real projects I use my IDE. For things that don't quite fit that routine, I might use my own scripts especially if I need repeatability. Or I type directly from the command line where even scripts are too formal.

It is in the latter cases where I was coming across invocations of programs like gcc where it has invented its own rules and folklore. I find that a nuisance.

This is where the suggestions start: nobody cares how you invoke gcc, it's usually invoked from a makefile script. So I'm slowly drawn into something that is 100 times worse than that minor nuisance of typing file extensions and providing options that should not be needed.

> > Do you routinely have to
> > invoke it five times in succession?
> No. I am giving typical example invocations.
> > Maybe that's a deeper problem with
> > it, but as I said I don't use it.
> Obviously.
> >> depending on what I'm doing rather than
> >>
> >> make makefile
> >> make makefile tests
> >> make makefile install
> >> make makefile clean
> >> make makefile mylib.a
> >
> > And this actually tells me that the main input is identical in all
> > cases;
> Yes, it's somewhat like a configuration file.

One that explains how a project is to work rather than the tool?

> > You can also choose to give it a shorter name than 'makefile'!
> Yes, but the typing is not, and never has been, the issue. If the name
> is not defaulted everyone has to guess where the rules for this project
> are stored.

Tool Projectname

> And it's redundant and intrusive to keep specifying the
> configuration, even if it's easy to type.

Well, you have to type something five times, whether it's 'make', 'make makefile', 'make lua', or a dedicated script called 'makelua', I don't see much difference.

Having the project name as part of the invocation I see as useful information and confirmation of what you are doing. You don't want to click on the wrong terminal window out of 6, type 'make', and you find it, a bit later, you're building the wrong project.

> > gcc is a bad example to follow since it does too much on the command
> > line and performs multiple functions.
> But it's what you were talking about. You seem to want it to do less.
> I don't.

I want it to compile C code, not any other language. But if I invoke it 10,000 times, I have to type .c 10,000 times (times the average number of modules) to tell it I'm compiling C and not C++, Ada or Fortran. If nothing else, it's not ergonomic.

I can fix this by providing wrapper to give the behaviour I want, but this seems wrong: gcc is already a driver program, and it's already huge, yet I have to provide yet another layer to make it usable?

Just deleting it and forgetting about C seems very attractive. You guys seem to want to 'own' C and its collection of idiosyncratic, *nix based tools and don't want to allow any other way of doing things. Just because 'that's how it's always been done.'

Re: Build Systems

<87cyziil9j.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27957&group=comp.lang.c#27957

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: Build Systems
Date: Sat, 19 Aug 2023 17:56:56 -0700
Organization: None to speak of
Lines: 34
Message-ID: <87cyziil9j.fsf@nosuchdomain.example.com>
References: <uban99$1rnpb$1@dont-email.me> <ubh3s8$30v7t$1@dont-email.me>
<ubi5do$38ii5$1@dont-email.me> <ubib54$39aqa$1@dont-email.me>
<ubii7m$3acds$1@dont-email.me> <ubivp8$3cjsl$1@dont-email.me>
<ubl89c$3prfv$1@dont-email.me> <ubma81$3upnp$1@dont-email.me>
<20230817183700.915@kylheku.com>
<011f0102-1241-464c-b628-0350c0be29fbn@googlegroups.com>
<87cyzjx4ob.fsf@bsb.me.uk> <Hx4EM.686038$TPw2.217661@fx17.iad>
<db175a13-352a-461b-88e4-d37e14d1a6e2n@googlegroups.com>
<a4aEM.562364$SuUf.473875@fx14.iad>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="86df45cf325c8ff7314c46ae427e3961";
logging-data="1126786"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Kq/h6iCm88s3GScspfEx5"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:ZKwQIdVZflbjq8jYnCULOtYV5G8=
sha1:E5UZ0pA3BpYqU/bptx5nZIRJ8ss=
 by: Keith Thompson - Sun, 20 Aug 2023 00:56 UTC

scott@slp53.sl.home (Scott Lurndal) writes:
> bart c <bart4858@gmail.com> writes:
[...]
>>So how do you directly invoke the actual C compiler?
>
> As if you don't already know.
>
> $ gcc -o a.o a.c

That creates an executable named "a.o". Bad idea.

> or
>
> $ gcc -o a a.c

That invokes the compiler and the linker.

To invoke just the compiler:

gcc -c a.c

which creates an object file named "a.o". If for some odd reason you
want the object file to have a different name:

gcc -c a.c -o foo.o

Giving an object file a name not ending in ".o" is almost certainly a
bad idea. (That's for Unix-like systems; other systems might have a
different convention like ".obj".)

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

Re: Build Systems

<c9837057-e084-4c5b-9d9a-e3ec316c2ecen@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27958&group=comp.lang.c#27958

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ad4:4f85:0:b0:64a:2de0:786e with SMTP id em5-20020ad44f85000000b0064a2de0786emr18889qvb.13.1692494024895;
Sat, 19 Aug 2023 18:13:44 -0700 (PDT)
X-Received: by 2002:aa7:88c9:0:b0:676:20f8:be57 with SMTP id
k9-20020aa788c9000000b0067620f8be57mr1921860pff.0.1692494024411; Sat, 19 Aug
2023 18:13:44 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 19 Aug 2023 18:13:43 -0700 (PDT)
In-Reply-To: <87cyziil9j.fsf@nosuchdomain.example.com>
Injection-Info: google-groups.googlegroups.com; posting-host=94.175.38.125; posting-account=rqC7UgoAAACeVvrGykivrxfPIl3bA_1y
NNTP-Posting-Host: 94.175.38.125
References: <uban99$1rnpb$1@dont-email.me> <ubh3s8$30v7t$1@dont-email.me>
<ubi5do$38ii5$1@dont-email.me> <ubib54$39aqa$1@dont-email.me>
<ubii7m$3acds$1@dont-email.me> <ubivp8$3cjsl$1@dont-email.me>
<ubl89c$3prfv$1@dont-email.me> <ubma81$3upnp$1@dont-email.me>
<20230817183700.915@kylheku.com> <011f0102-1241-464c-b628-0350c0be29fbn@googlegroups.com>
<87cyzjx4ob.fsf@bsb.me.uk> <Hx4EM.686038$TPw2.217661@fx17.iad>
<db175a13-352a-461b-88e4-d37e14d1a6e2n@googlegroups.com> <a4aEM.562364$SuUf.473875@fx14.iad>
<87cyziil9j.fsf@nosuchdomain.example.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c9837057-e084-4c5b-9d9a-e3ec316c2ecen@googlegroups.com>
Subject: Re: Build Systems
From: bart4...@gmail.com (bart c)
Injection-Date: Sun, 20 Aug 2023 01:13:44 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2939
 by: bart c - Sun, 20 Aug 2023 01:13 UTC

On Sunday, 20 August 2023 at 01:57:13 UTC+1, Keith Thompson wrote:
> sc...@slp53.sl.home (Scott Lurndal) writes:
> > bart c <bart...@gmail.com> writes:
> [...]
> >>So how do you directly invoke the actual C compiler?
> >
> > As if you don't already know.
> >
> > $ gcc -o a.o a.c
> That creates an executable named "a.o". Bad idea.
> > or
> >
> > $ gcc -o a a.c
> That invokes the compiler and the linker.
>
> To invoke just the compiler:
>
> gcc -c a.c
>
> which creates an object file named "a.o". If for some odd reason you
> want the object file to have a different name:
>
> gcc -c a.c -o foo.o
>
> Giving an object file a name not ending in ".o" is almost certainly a
> bad idea. (That's for Unix-like systems; other systems might have a
> different convention like ".obj".)

Also, none of these /directly/ invoke the compiler. Using your suggestion, gcc uses an invocation like this, on Windows:

C:/tdm/bin/../libexec/gcc/x86_64-w64-mingw32/10.3.0/cc1.exe -quiet -v -iprefix C:/tdm/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/ -D_REENTRANT hello.c -quiet -dumpbase hello.c -mtune=generic -march=x86-64 -auxbase hello -version -o C:\Users\xxxxx\AppData\Local\Temp\ccJo76DR.s

It doesn't look very user friendly.

Re: Build Systems

<218c5dbe-3457-4fa5-a89d-d35314d3405an@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27961&group=comp.lang.c#27961

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:3884:b0:76d:a231:7c92 with SMTP id qp4-20020a05620a388400b0076da2317c92mr6324qkn.9.1692529321548;
Sun, 20 Aug 2023 04:02:01 -0700 (PDT)
X-Received: by 2002:a05:6a00:2d96:b0:687:427c:1ad2 with SMTP id
fb22-20020a056a002d9600b00687427c1ad2mr2284475pfb.1.1692529321205; Sun, 20
Aug 2023 04:02:01 -0700 (PDT)
Path: i2pn2.org!rocksolid2!i2pn.org!paganini.bofh.team!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sun, 20 Aug 2023 04:02:00 -0700 (PDT)
In-Reply-To: <ubov2e$eaa2$2@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=94.175.38.125; posting-account=rqC7UgoAAACeVvrGykivrxfPIl3bA_1y
NNTP-Posting-Host: 94.175.38.125
References: <uban99$1rnpb$1@dont-email.me> <87ttt2isc8.fsf@bsb.me.uk>
<ubd8t6$2b62u$1@dont-email.me> <ubdbtc$2bl3l$1@dont-email.me>
<12sCM.59051$m8Ke.22097@fx08.iad> <ubdmk4$2dao7$1@dont-email.me>
<ubfeqj$2oop4$1@dont-email.me> <ubfknf$2plvs$1@dont-email.me>
<ubfu4d$2r98d$1@dont-email.me> <ubg4jr$2se4o$1@dont-email.me>
<ubg7ku$2srfk$1@dont-email.me> <ubgdr5$2tro0$1@dont-email.me>
<ubgpip$2vk5e$1@dont-email.me> <ubgulr$3095n$1@dont-email.me>
<87pm3nlxuu.fsf@nosuchdomain.example.com> <ubh3s8$30v7t$1@dont-email.me>
<ubi5do$38ii5$1@dont-email.me> <ubib54$39aqa$1@dont-email.me>
<ubii7m$3acds$1@dont-email.me> <ublh4b$3r6ta$1@dont-email.me>
<ubnru5$99au$1@dont-email.me> <8368cf0e-ed7c-4301-8301-d6e61ea972c0n@googlegroups.com>
<ubo1mn$a5qj$1@dont-email.me> <3befa002-b95b-492a-b652-92df19d838d2n@googlegroups.com>
<ubov2e$eaa2$2@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <218c5dbe-3457-4fa5-a89d-d35314d3405an@googlegroups.com>
Subject: Re: Build Systems
From: bart4...@gmail.com (bart c)
Injection-Date: Sun, 20 Aug 2023 11:02:01 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: bart c - Sun, 20 Aug 2023 11:02 UTC

On Saturday, 19 August 2023 at 00:32:39 UTC+1, Chris M. Thomasson wrote:
> On 8/18/2023 8:58 AM, bart c wrote:
> > On Friday, 18 August 2023 at 16:11:35 UTC+1, David Brown wrote:
> >> On 18/08/2023 16:48, bart c wrote:
> >>> On Friday, 18 August 2023 at 14:33:08 UTC+1, David Brown wrote:
> >>>> On 17/08/2023 18:16, Bart wrote:
> >>
> >>>>> This is an analogy I have used before regarding LLVM, which is a backend
> >>>>> for language implementations. It is quite large and complex.
> >>>>>
> >>>>> Once I needed a side-gate for my house. I made it myself, and ended up
> >>>>> with a 6' high wooden gate, of just the right size.
> >>>>>
> >>>>> Now if I'd gone to the LLVM shop as a solution, the gate would have been
> >>>>> 9 miles high - if I could ever figure it out.
> >>>>>
> >>>> As analogies go, that's a particularly silly one.
> >>>
> >>> LLVM in concept is simple: feed it some IL (or it calls it IR), and it turns it into a runnable binary. The actuality is very different.
> >>>
> >>> I created my own similar product in 2021, which was a 0.2MB binary. The downloads needs to get started with LLVM are some 2.3GB. That's how you get from 6 feet to 9 miles. But the biggest obstacle is the sheer complexity, with 100 /sets/ of documentation.
> >>>
> >> Doesn't the quantity of documentation in llvm give you a hint that
> >> perhaps your product is /not/ similar?
> >
> > The point of using LLVM is similar to that of targetting C:
> >
> > * You don't want the bother of writing the backend of a compiler
> >
> > * You want portability by not generating different code for x64/arm, Linux/Windows etc
> >
> > * You want to take advantage of optimisation
> >
> > You don't however need that amount of documentation to use C; so C is far simpler.
> >
> > An IL would be a much simpler language than C.
> >
> > For the IL I use (based on a stack-based VM), a portable interpreter can be written in 0.1MB. A program to turn it into native code would be 0.2MB per target.
> >
> > The task is just not complex. Unless you want code that is optimised, but it might be a magnitude bigger task to get it good enough; it won't be several magnitudes bigger.
> >
> >
> Fwiw, remember when you told me that my experimental C cipher code did
> not compile in Tiny C. Then, we worked together and it did end up
> compiling? Remember that thread?

Sure. It's still one of my favourite C tests. It was just the right size for tests and demos of building a 3-module project.

And it was also perfectly structured (because the .c and .h files are tidily matched in pairs) to try an experimental feature of my compiler:

bcc -auto cipher

instead of:

bcc cipher hmac sha2

But, even that is better than gcc's:

gcc cipher.c hmac.c sha2.c -ocipher -O3

That last option is not needed, but the main reason for using gcc in a routine build is to benefit from its optimiser.

(Please no one mention the M-word again! I've had enough of prehistoric build methods and dinosaur compilers.)

Re: Build Systems

<ubt01p$1bhkn$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27964&group=comp.lang.c#27964

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: Build Systems
Date: Sun, 20 Aug 2023 14:13:45 +0200
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <ubt01p$1bhkn$2@dont-email.me>
References: <uban99$1rnpb$1@dont-email.me> <ubh3s8$30v7t$1@dont-email.me>
<ubi5do$38ii5$1@dont-email.me> <ubib54$39aqa$1@dont-email.me>
<ubii7m$3acds$1@dont-email.me> <ubivp8$3cjsl$1@dont-email.me>
<ubl89c$3prfv$1@dont-email.me> <ubma81$3upnp$1@dont-email.me>
<20230817183700.915@kylheku.com>
<011f0102-1241-464c-b628-0350c0be29fbn@googlegroups.com>
<87cyzjx4ob.fsf@bsb.me.uk> <Hx4EM.686038$TPw2.217661@fx17.iad>
<db175a13-352a-461b-88e4-d37e14d1a6e2n@googlegroups.com>
<a4aEM.562364$SuUf.473875@fx14.iad> <87cyziil9j.fsf@nosuchdomain.example.com>
<c9837057-e084-4c5b-9d9a-e3ec316c2ecen@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 20 Aug 2023 12:13:46 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="28a5ce0b91d98d1cfdd2d8454cd084fc";
logging-data="1427095"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+mFHtMPGYE7AStt5vFt8zlB07jdC2kaPQ="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:xfkwuqSkkxDw2BS0DNS54KwRkLo=
In-Reply-To: <c9837057-e084-4c5b-9d9a-e3ec316c2ecen@googlegroups.com>
Content-Language: en-GB
 by: David Brown - Sun, 20 Aug 2023 12:13 UTC

On 20/08/2023 03:13, bart c wrote:
> On Sunday, 20 August 2023 at 01:57:13 UTC+1, Keith Thompson wrote:
>> sc...@slp53.sl.home (Scott Lurndal) writes:
>>> bart c <bart...@gmail.com> writes:
>> [...]
>>>> So how do you directly invoke the actual C compiler?
>>>
>>> As if you don't already know.
>>>
>>> $ gcc -o a.o a.c
>> That creates an executable named "a.o". Bad idea.
>>> or
>>>
>>> $ gcc -o a a.c
>> That invokes the compiler and the linker.
>>
>> To invoke just the compiler:
>>
>> gcc -c a.c
>>
>> which creates an object file named "a.o". If for some odd reason you
>> want the object file to have a different name:
>>
>> gcc -c a.c -o foo.o
>>
>> Giving an object file a name not ending in ".o" is almost certainly a
>> bad idea. (That's for Unix-like systems; other systems might have a
>> different convention like ".obj".)
>
> Also, none of these /directly/ invoke the compiler. Using your suggestion, gcc uses an invocation like this, on Windows:
>
> C:/tdm/bin/../libexec/gcc/x86_64-w64-mingw32/10.3.0/cc1.exe -quiet -v -iprefix C:/tdm/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/ -D_REENTRANT hello.c -quiet -dumpbase hello.c -mtune=generic -march=x86-64 -auxbase hello -version -o C:\Users\xxxxx\AppData\Local\Temp\ccJo76DR.s
>
> It doesn't look very user friendly.

It isn't user friendly - nor is it intended to be. It is intended that
you use "gcc" (or "g++", "gfortran", or other drivers that are
convenient for other gcc languages) as the driver program that will then
invoke "cc1" with whatever options are needed. The options and
interface for "cc1" are not considered user documentation - they are
internal, might not be complete, and may change wildly between versions
of gcc. It is the options for "gcc" that are documented for user usage.

Re: Build Systems

<ubt057$1bhkn$3@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27965&group=comp.lang.c#27965

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: Build Systems
Date: Sun, 20 Aug 2023 14:15:35 +0200
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <ubt057$1bhkn$3@dont-email.me>
References: <uban99$1rnpb$1@dont-email.me> <ubdmk4$2dao7$1@dont-email.me>
<ubfeqj$2oop4$1@dont-email.me> <ubfknf$2plvs$1@dont-email.me>
<ubfu4d$2r98d$1@dont-email.me> <ubg4jr$2se4o$1@dont-email.me>
<ubg7ku$2srfk$1@dont-email.me> <ubgdr5$2tro0$1@dont-email.me>
<ubgpip$2vk5e$1@dont-email.me> <ubgulr$3095n$1@dont-email.me>
<ubi4id$38esc$1@dont-email.me>
<7fb8d5b6-4172-4bf8-a3e9-858d02b5e193n@googlegroups.com>
<ubi9pf$394g8$2@dont-email.me>
<d0fbf07d-f1b5-4aa8-ac8e-a954addb6358n@googlegroups.com>
<zvrDM.215514$uLJb.196259@fx41.iad> <87sf8f9tq8.fsf@fatphil.org>
<cd21da1c-859b-4b22-90c6-87cf19ab250bn@googlegroups.com>
<ubqkkv$sjb3$1@dont-email.me> <20230819085912.518@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 20 Aug 2023 12:15:35 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="28a5ce0b91d98d1cfdd2d8454cd084fc";
logging-data="1427095"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+S1OAvz03FZx5RBiDQh6TakNFq8mjqgEs="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:Ha4CetCMT01FGzVYv8GZ6wxdGyE=
In-Reply-To: <20230819085912.518@kylheku.com>
Content-Language: en-GB
 by: David Brown - Sun, 20 Aug 2023 12:15 UTC

On 19/08/2023 18:00, Kaz Kylheku wrote:
> On 2023-08-19, David Brown <david.brown@hesbynett.no> wrote:
>> On 19/08/2023 13:39, bart c wrote:
>>> That's interesting. One of the limitations of Lua was that it didn't have proper integer type, it used a 64-bit float.
>>>
>>
>> Lua is configurable, and can support different types. When I embedded
>> in a 32-bit microcontroller program, I use 32-bit integers as the number
>> type.
>
> I don't feel the party has properly started until someone makes that
> sort of thing a command line option. Or better yet, environment
> variable.
>

I don't think something like that would be remotely helpful for Lua, but
that is possibly due to my lack of experience with the language. You'd
get a more complete answer from a Lua newsgroup.

Re: Build Systems

<1075f829-1174-4456-b57d-74331cd61aa8n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27966&group=comp.lang.c#27966

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:608c:b0:76d:473:2e74 with SMTP id dx12-20020a05620a608c00b0076d04732e74mr33458qkb.6.1692536705017;
Sun, 20 Aug 2023 06:05:05 -0700 (PDT)
X-Received: by 2002:a63:7f02:0:b0:565:5555:1694 with SMTP id
a2-20020a637f02000000b0056555551694mr663420pgd.1.1692536704499; Sun, 20 Aug
2023 06:05:04 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sun, 20 Aug 2023 06:05:04 -0700 (PDT)
In-Reply-To: <ubt01p$1bhkn$2@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=94.175.38.125; posting-account=rqC7UgoAAACeVvrGykivrxfPIl3bA_1y
NNTP-Posting-Host: 94.175.38.125
References: <uban99$1rnpb$1@dont-email.me> <ubh3s8$30v7t$1@dont-email.me>
<ubi5do$38ii5$1@dont-email.me> <ubib54$39aqa$1@dont-email.me>
<ubii7m$3acds$1@dont-email.me> <ubivp8$3cjsl$1@dont-email.me>
<ubl89c$3prfv$1@dont-email.me> <ubma81$3upnp$1@dont-email.me>
<20230817183700.915@kylheku.com> <011f0102-1241-464c-b628-0350c0be29fbn@googlegroups.com>
<87cyzjx4ob.fsf@bsb.me.uk> <Hx4EM.686038$TPw2.217661@fx17.iad>
<db175a13-352a-461b-88e4-d37e14d1a6e2n@googlegroups.com> <a4aEM.562364$SuUf.473875@fx14.iad>
<87cyziil9j.fsf@nosuchdomain.example.com> <c9837057-e084-4c5b-9d9a-e3ec316c2ecen@googlegroups.com>
<ubt01p$1bhkn$2@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1075f829-1174-4456-b57d-74331cd61aa8n@googlegroups.com>
Subject: Re: Build Systems
From: bart4...@gmail.com (bart c)
Injection-Date: Sun, 20 Aug 2023 13:05:05 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: bart c - Sun, 20 Aug 2023 13:05 UTC

On Sunday, 20 August 2023 at 13:14:00 UTC+1, David Brown wrote:
> On 20/08/2023 03:13, bart c wrote:
> > On Sunday, 20 August 2023 at 01:57:13 UTC+1, Keith Thompson wrote:
> >> sc...@slp53.sl.home (Scott Lurndal) writes:
> >>> bart c <bart...@gmail.com> writes:
> >> [...]
> >>>> So how do you directly invoke the actual C compiler?
> >>>
> >>> As if you don't already know.
> >>>
> >>> $ gcc -o a.o a.c
> >> That creates an executable named "a.o". Bad idea.
> >>> or
> >>>
> >>> $ gcc -o a a.c
> >> That invokes the compiler and the linker.
> >>
> >> To invoke just the compiler:
> >>
> >> gcc -c a.c
> >>
> >> which creates an object file named "a.o". If for some odd reason you
> >> want the object file to have a different name:
> >>
> >> gcc -c a.c -o foo.o
> >>
> >> Giving an object file a name not ending in ".o" is almost certainly a
> >> bad idea. (That's for Unix-like systems; other systems might have a
> >> different convention like ".obj".)
> >
> > Also, none of these /directly/ invoke the compiler. Using your suggestion, gcc uses an invocation like this, on Windows:
> >
> > C:/tdm/bin/../libexec/gcc/x86_64-w64-mingw32/10.3.0/cc1.exe -quiet -v -iprefix C:/tdm/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/ -D_REENTRANT hello..c -quiet -dumpbase hello.c -mtune=generic -march=x86-64 -auxbase hello -version -o C:\Users\xxxxx\AppData\Local\Temp\ccJo76DR.s
> >
> > It doesn't look very user friendly.
> It isn't user friendly - nor is it intended to be. It is intended that
> you use "gcc" (or "g++", "gfortran", or other drivers that are
> convenient for other gcc languages) as the driver program that will then
> invoke "cc1" with whatever options are needed. The options and
> interface for "cc1" are not considered user documentation - they are
> internal, might not be complete, and may change wildly between versions
> of gcc. It is the options for "gcc" that are documented for user usage.

How about 'ld'; is that supposed to be directly usable? The gcc -v option doesn't show the arguments to 'ld'; I have to determine those myself. For 'gcc hello.c', they are these (number `1 is the invocation):

1: C:/tdm/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe
2: -plugin
3: C:/tdm/bin/../libexec/gcc/x86_64-w64-mingw32/10.3.0/liblto_plugin-0.dll
4: -plugin-opt=C:/tdm/bin/../libexec/gcc/x86_64-w64-mingw32/10.3.0/lto-wrapper.exe
5: -plugin-opt=-fresolution=C:\Users\44775\AppData\Local\Temp\ccZgT4Qq.res
6: -plugin-opt=-pass-through=-lmingw32
7: -plugin-opt=-pass-through=-lgcc
8: -plugin-opt=-pass-through=-lpthread
9: -plugin-opt=-pass-through=-lgcc
10: -plugin-opt=-pass-through=-lkernel32
11: -plugin-opt=-pass-through=-lmoldname
12: -plugin-opt=-pass-through=-lmingwex
13: -plugin-opt=-pass-through=-lmsvcrt
14: -plugin-opt=-pass-through=-lkernel32
15: -plugin-opt=-pass-through=-lpthread
16: -plugin-opt=-pass-through=-ladvapi32
17: -plugin-opt=-pass-through=-lshell32
18: -plugin-opt=-pass-through=-luser32
19: -plugin-opt=-pass-through=-lkernel32
20: -plugin-opt=-pass-through=-lmingw32
21: -plugin-opt=-pass-through=-lgcc
22: -plugin-opt=-pass-through=-lpthread
23: -plugin-opt=-pass-through=-lgcc
24: -plugin-opt=-pass-through=-lkernel32
25: -plugin-opt=-pass-through=-lmoldname
26: -plugin-opt=-pass-through=-lmingwex
27: -plugin-opt=-pass-through=-lmsvcrt
28: -plugin-opt=-pass-through=-lkernel32
29: -m
30: i386pep
31: --exclude-libs=libpthread.a
32: --undefined=__xl_f
33: -Bdynamic
34: C:/tdm/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o
35: C:/tdm/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/crtbegin.o
36: -LC:/tdm/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0
37: -LC:/tdm/bin/../lib/gcc
38: -LC:/tdm/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/lib/../lib
39: -LC:/tdm/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../lib
40: -LC:/tdm/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/lib
41: -LC:/tdm/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../..
42: C:\Users\44775\AppData\Local\Temp\ccS1MzGi.o
43: -lmingw32
44: -lgcc
45: -lpthread
46: -lgcc
47: -lkernel32
48: -lmoldname
49: -lmingwex
50: -lmsvcrt
51: -lkernel32
52: -lpthread
53: -ladvapi32
54: -lshell32
55: -luser32
56: -lkernel32
57: -lmingw32
58: -lgcc
59: -lpthread
60: -lgcc
61: -lkernel32
62: -lmoldname
63: -lmingwex
64: -lmsvcrt
65: -lkernel32
66: C:/tdm/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/lib/../lib/default-manifest.o
67: C:/tdm/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/crtend.o

(This is 10.3.0; 13.2 has 'only' 53.)

I suppose this is not really relevant, so long as somebody can climb to the top of this heap of complexity and plant a flag saying only 'Make`. Then it doesn't matter if its Mount Everest or an anthill. Or does it?

BTW 'gcc hello.c' creates a 367KB executable; 'tcc hello.c' created a 2KB executable. Just saying...

Maybe there is also a reason why -lgcc is specified four times.

Re: Dev on Windoze

<87o7j1am9a.fsf@fatphil.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27967&group=comp.lang.c#27967

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: pc+use...@asdf.org (Phil Carmody)
Newsgroups: comp.lang.c
Subject: Re: Dev on Windoze
Date: Sun, 20 Aug 2023 16:14:57 +0300
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <87o7j1am9a.fsf@fatphil.org>
References: <uban99$1rnpb$1@dont-email.me> <PPeCM.479849$TCKc.32962@fx13.iad>
<ubbule$3hium$3@news.xmission.com>
<8fb22829-9b5e-4108-a513-df3b72391405n@googlegroups.com>
<ubc4e0$3hlul$1@news.xmission.com>
<slrnudt64j.2ek.matt@imladris.colo.ub3rgeek.net>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="adc0bed84b9fd324329010ef07db31f2";
logging-data="1446181"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/+3luYn3VGClxMFzuxEWi0"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:Ma7aqKyu+HvB+pxYxeSqk29nJdU=
sha1:8j1IsrV0mATSN9UZyYW2+oZsNMs=
 by: Phil Carmody - Sun, 20 Aug 2023 13:14 UTC

Matthew Ernisse <matt@going-flying.com> writes:
> On Mon, 14 Aug 2023 02:44:16 -0000 (UTC), Kenny McCormack wrote:
>> In article <8fb22829-9b5e-4108-a513-df3b72391405n@googlegroups.com>,
>> Malcolm McLean <malcolm.arthur.mclean@gmail.com> wrote:
>> ...
>>>> DOS/Windows (and Mac similarly) has *never* shipped with any sort of
>>>> development environment, so arguing that it doesn't have "make" is kind of
>>>> pointless.
>>
>> I may actually have mis-spoken here. DOS did originally come with GWBASIC,
>> so you could, at least write and run programs back then.
>
> Later DOS version (I think 6+) came with QBASIC which was pretty close to
> an early IDE, reasoned individuals may debate whether it is a development
> environment but I believe I recall single-stepping in it.

DOS 5 came with GORILLA.BAS, that I do remember.

Phil
--
We are no longer hunters and nomads. No longer awed and frightened, as we have
gained some understanding of the world in which we live. As such, we can cast
aside childish remnants from the dawn of our civilization.
-- NotSanguine on SoylentNews, after Eugen Weber in /The Western Tradition/

Re: Build Systems

<ubt762$1cngj$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=27970&group=comp.lang.c#27970

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: Build Systems
Date: Sun, 20 Aug 2023 16:15:30 +0200
Organization: A noiseless patient Spider
Lines: 57
Message-ID: <ubt762$1cngj$2@dont-email.me>
References: <uban99$1rnpb$1@dont-email.me> <ubh3s8$30v7t$1@dont-email.me>
<ubi5do$38ii5$1@dont-email.me> <ubib54$39aqa$1@dont-email.me>
<ubii7m$3acds$1@dont-email.me> <ubivp8$3cjsl$1@dont-email.me>
<ubl89c$3prfv$1@dont-email.me> <ubma81$3upnp$1@dont-email.me>
<20230817183700.915@kylheku.com>
<011f0102-1241-464c-b628-0350c0be29fbn@googlegroups.com>
<87cyzjx4ob.fsf@bsb.me.uk> <Hx4EM.686038$TPw2.217661@fx17.iad>
<db175a13-352a-461b-88e4-d37e14d1a6e2n@googlegroups.com>
<a4aEM.562364$SuUf.473875@fx14.iad> <87cyziil9j.fsf@nosuchdomain.example.com>
<c9837057-e084-4c5b-9d9a-e3ec316c2ecen@googlegroups.com>
<ubt01p$1bhkn$2@dont-email.me>
<1075f829-1174-4456-b57d-74331cd61aa8n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 20 Aug 2023 14:15:30 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="28a5ce0b91d98d1cfdd2d8454cd084fc";
logging-data="1465875"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/1xpx8bwr6ZQOKbSkxLFyHalvWwIxwRqw="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:boKBjXAYhrspuwq0P67ex6qEyRk=
Content-Language: en-GB
In-Reply-To: <1075f829-1174-4456-b57d-74331cd61aa8n@googlegroups.com>
 by: David Brown - Sun, 20 Aug 2023 14:15 UTC

On 20/08/2023 15:05, bart c wrote:
> On Sunday, 20 August 2023 at 13:14:00 UTC+1, David Brown wrote:
>> On 20/08/2023 03:13, bart c wrote:
>>> On Sunday, 20 August 2023 at 01:57:13 UTC+1, Keith Thompson wrote:
>>>> sc...@slp53.sl.home (Scott Lurndal) writes:
>>>>> bart c <bart...@gmail.com> writes:
>>>> [...]
>>>>>> So how do you directly invoke the actual C compiler?
>>>>>
>>>>> As if you don't already know.
>>>>>
>>>>> $ gcc -o a.o a.c
>>>> That creates an executable named "a.o". Bad idea.
>>>>> or
>>>>>
>>>>> $ gcc -o a a.c
>>>> That invokes the compiler and the linker.
>>>>
>>>> To invoke just the compiler:
>>>>
>>>> gcc -c a.c
>>>>
>>>> which creates an object file named "a.o". If for some odd reason you
>>>> want the object file to have a different name:
>>>>
>>>> gcc -c a.c -o foo.o
>>>>
>>>> Giving an object file a name not ending in ".o" is almost certainly a
>>>> bad idea. (That's for Unix-like systems; other systems might have a
>>>> different convention like ".obj".)
>>>
>>> Also, none of these /directly/ invoke the compiler. Using your suggestion, gcc uses an invocation like this, on Windows:
>>>
>>> C:/tdm/bin/../libexec/gcc/x86_64-w64-mingw32/10.3.0/cc1.exe -quiet -v -iprefix C:/tdm/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/ -D_REENTRANT hello.c -quiet -dumpbase hello.c -mtune=generic -march=x86-64 -auxbase hello -version -o C:\Users\xxxxx\AppData\Local\Temp\ccJo76DR.s
>>>
>>> It doesn't look very user friendly.
>> It isn't user friendly - nor is it intended to be. It is intended that
>> you use "gcc" (or "g++", "gfortran", or other drivers that are
>> convenient for other gcc languages) as the driver program that will then
>> invoke "cc1" with whatever options are needed. The options and
>> interface for "cc1" are not considered user documentation - they are
>> internal, might not be complete, and may change wildly between versions
>> of gcc. It is the options for "gcc" that are documented for user usage.
>
> How about 'ld'; is that supposed to be directly usable?

"ld" is not part of gcc. It is part of an independent project,
binutils, that is often used alongside gcc. (You know this, of course,
and only feign ignorance.) For user convenience, gcc configurations can
generally invoke a system linker or other configured linker from the gcc
driver program - and in many, but not all, gcc toolchains, that will be
binutils "ld".

So "ld" is very much designed to be usable directly - you'll find
documentation for it in the documentation for the "binutils" project.


devel / comp.lang.c / Re: Build Systems

Pages:12345678910111213
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor