Skip to content

Command-line DEFINES suppresses the Makefile's _FILE_OFFSET_BITS append #101

Description

@ChristopherA

57fa48c5 ("Don't override DEFINES, but add to it.") changes container/update:11 from DEFINES="$DEFINES" to DEFINES+="$DEFINES". On the command line += does not have that effect: a command-line assignment suppresses a makefile's plain += whichever operator is used, so both forms drop src/Makefile:54's DEFINES+=-D_FILE_OFFSET_BITS=64.

Measured on an unmodified checkout at 57fa48c5, reading the first c++ -c line out of make -n:

invocation -D_FILE_OFFSET_BITS=64
make present
make DEFINES=-DFOO dropped
make DEFINES+=-DFOO dropped
make DEFINES+= dropped

The two middle rows are byte-identical compile lines, so the commit changes nothing. The last row shows why: an empty command-line DEFINES+= drops the flag too, so no value is involved -- it is the assignment's origin that suppresses the makefile's append.

Two environments, identical results, so this is not an artifact of one make generation:

  • Debian 12 (bookworm), aarch64, GNU Make 4.3, g++ 12.2.0. HOST auto-detects as LINUX, so the table is exactly what runs.
  • macOS 26.5.1, arm64, GNU Make 3.81, Apple clang 21. HOST is DARWIN here, so reaching the branch needs HOST=LINUX on the command line; every row then matches Debian's.

override DEFINES += at src/Makefile:54 and :62 fixes it -- same checkouts, that edit and nothing else:

invocation -D_FILE_OFFSET_BITS=64
make present
make DEFINES=-DFOO present
make DEFINES+=-DFOO present

and make DEFINES=-DFOO then carries both -DFOO and -D_FILE_OFFSET_BITS=64, so the override does not clobber the caller's own defines. Identical on both make versions.

Scope, which is narrower than it first looks, and I would rather state it than have you find it. container/Dockerfile is FROM alpine:3.13, and musl does not consult _FILE_OFFSET_BITS at all: on alpine:3.13.12 with musl-dev installed, 0 of 217 headers reference it, against 14 that mention off_t. So the container is unaffected either way and 57fa48c5 is inert there rather than harmful. What remains is the Makefile behaviour itself, which matters to anyone passing DEFINES on the command line for a 32-bit glibc or Solaris build, where that append is what sets a 64-bit off_t.

That is how this surfaced: the wider-index recipe in #100 passes DEFINES on the command line, which silently drops the append on those targets, so our own Linux builds restate -D_FILE_OFFSET_BITS=64 by hand.

One inconsistency in the same commit, whatever you decide about the above: it changes only the dgd line at :11. The lpc-ext line at :13 still reads DEFINES="$DEFINES", so even granting the operator behaved as intended, the change would be half-applied within its own file.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed as a bug.feedbackAwaiting feedback from original reporter.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions