Bug 116123 - flex generated files should be produced in the source tree with --enable-generated-files-in-srcdir so that flex is not needed on build for releases
Summary: flex generated files should be produced in the source tree with --enable-gene...
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: modula2 (show other bugs)
Version: 15.0
: P3 normal
Target Milestone: ---
Assignee: Gaius Mulley
URL:
Keywords: build
Depends on:
Blocks:
 
Reported: 2024-07-28 13:46 UTC by Gaius Mulley
Modified: 2024-07-29 06:53 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2024-07-28 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gaius Mulley 2024-07-28 13:46:53 UTC
Currently m2 requires that GNU flex is installed, it would be good to commit the built flex file into git and only rebuild this file if maintainer is specified.
Comment 1 Andrew Pinski 2024-07-28 17:16:10 UTC
flex is required for building GCC from git even without m2.

gengtype-lex.l needs to be processed by flex.
Comment 2 Andrew Pinski 2024-07-28 17:16:51 UTC
https://gcc.gnu.org/install/prerequisites.html


Flex version 2.5.4 (or later)
Necessary when modifying *.l files.

Necessary to build GCC during development because the generated output files are not included in the version-controlled source repository. They are included in releases.
Comment 3 Andrew Pinski 2024-07-28 17:17:32 UTC
Fixing m2 is not going to change you still need flex to build so closing as invalid.
Comment 4 Sam James 2024-07-28 17:19:04 UTC
(In reply to Andrew Pinski from comment #1)
> flex is required for building GCC from git even without m2.
> 
> gengtype-lex.l needs to be processed by flex.

Yes, I was surprised to see FX ask for this because it's definitely needed...

(ref. https://inbox.sourceware.org/gcc/F2B9E804-0226-4851-969C-2EC584B62FDB@gmail.com/).

See also PR106899. But really, I don't see how needing flex is a big problem.
Comment 5 Andrew Pinski 2024-07-28 17:20:36 UTC
But flex should not be needed to build releases. So --enable-generated-files-in-srcdir should work here ...
Comment 6 Andrew Pinski 2024-07-28 17:21:07 UTC
From maintainer-scripts/gcc_release :
    contrib/gcc_build -d ${SOURCE_DIRECTORY} -o ${OBJECT_DIRECTORY} \
      -c "--enable-generated-files-in-srcdir --disable-multilib" \
      -m "-j$num_cpus" build || \
      error "Could not rebuild GCC"
Comment 7 Andrew Pinski 2024-07-28 17:24:47 UTC
(In reply to Andrew Pinski from comment #6)
> From maintainer-scripts/gcc_release :
>     contrib/gcc_build -d ${SOURCE_DIRECTORY} -o ${OBJECT_DIRECTORY} \
>       -c "--enable-generated-files-in-srcdir --disable-multilib" \
>       -m "-j$num_cpus" build || \
>       error "Could not rebuild GCC"

wait that does not enable m2 ... maybe that is the issue.