Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 883611 - sys-devel/reflex-20221012 - main.c:(.text+<snip>): undefined reference to set_input_file
Summary: sys-devel/reflex-20221012 - main.c:(.text+<snip>): undefined reference to set...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sam James
URL:
Whiteboard:
Keywords:
Depends on: 899976
Blocks: parallel-make
  Show dependency tree
 
Reported: 2022-11-29 18:06 UTC by Toralf Förster
Modified: 2023-05-31 00:28 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.txt (emerge-info.txt,19.55 KB, text/plain)
2022-11-29 18:06 UTC, Toralf Förster
Details
emerge-history.txt.bz2 (emerge-history.txt.bz2,54.28 KB, application/x-bzip)
2022-11-29 18:06 UTC, Toralf Förster
Details
environment (environment,30.16 KB, text/plain)
2022-11-29 18:06 UTC, Toralf Förster
Details
etc.clang.tar.bz2 (etc.clang.tar.bz2,707 bytes, application/x-bzip)
2022-11-29 18:06 UTC, Toralf Förster
Details
etc.portage.tar.bz2 (etc.portage.tar.bz2,7.37 KB, application/x-bzip)
2022-11-29 18:06 UTC, Toralf Förster
Details
logs.tar.bz2 (logs.tar.bz2,4.54 KB, application/x-bzip)
2022-11-29 18:06 UTC, Toralf Förster
Details
sys-devel:reflex-20221012:20221129-152755.log (sys-devel:reflex-20221012:20221129-152755.log,11.10 KB, text/plain)
2022-11-29 18:06 UTC, Toralf Förster
Details
temp.tar.bz2 (temp.tar.bz2,11.23 KB, application/x-bzip)
2022-11-29 18:06 UTC, Toralf Förster
Details
build with MAKEOPTS="-d --shuffle=1146935951 -j32" (file_883611.txt,325.58 KB, text/plain)
2023-02-07 22:42 UTC, Sam James
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2022-11-29 18:06:14 UTC
x86_64-pc-linux-gnu-gcc -c -I. -I. -DHAVE_CONFIG_H -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=500 -DFLEXLEXER_HDR=\"`echo FlexLexer|sed 's,^,re,'`.h\" -pipe -march=native -fno-diagnostics-color -O2  yylex.c
x86_64-pc-linux-gnu-gcc -pipe -march=native -fno-diagnostics-color -O2 -o flex -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 ccl.o dfa.o ecs.o gen.o main.o misc.o nfa.o parse.o scan.o skel.o sym.o tblcmp.o yylex.o  libfl.a 
/usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: yylex.o: warning: relocation against `yytext' in read-only section `.text'
/usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: main.o: in function `flexinit':
main.c:(.text+0x277c): undefined reference to `set_input_file'
/usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: dfa.o: in function `ntod':
dfa.c:(.text+0x1a14): undefined reference to `flex_free'

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1_desktop_gnome_systemd-j4-20221127-160925

  -------------------------------------------------------------------

GNUMAKEFLAGS="$GNUMAKEFLAGS --jobserver-style=pipe"
GNUMAKEFLAGS="$GNUMAKEFLAGS --shuffle"
gcc-config -l:
 [1] x86_64-pc-linux-gnu-11
 [2] x86_64-pc-linux-gnu-12 *
clang/llvm (if any):
clang version 15.0.5
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/15/bin
Configuration file: /etc/clang/clang.cfg
/usr/lib/llvm/15
15.0.5
Python 3.10.8
Available Ruby profiles:
  [1]   ruby27 (with Rubygems)
  [2]   ruby31 (with Rubygems) *
Available Rust versions:
  [1]   rust-bin-1.65.0 *
The following VMs are available for generation-2:
*)	Eclipse Temurin JDK 17.0.5_p8 [openjdk-bin-17]
2)	Eclipse Temurin JDK 8.352_p08 [openjdk-bin-8]
Available Java Virtual Machines:
  [1]   openjdk-bin-8 
  [2]   openjdk-bin-17  system-vm

php cli (if any):
  [1]   php7.4 *
  [2]   php8.0
  [3]   php8.1

  HEAD of ::gentoo
commit 778e45dc15e4ddaf1657741f0230427df3d219a8
Author: Repository mirror & CI <repomirrorci@gentoo.org>
Date:   Tue Nov 29 14:02:03 2022 +0000

    2022-11-29 14:02:02 UTC

emerge -qpvO sys-devel/reflex
[ebuild  N    ] sys-devel/reflex-20221012  USE="-verify-sig"
Comment 1 Toralf Förster gentoo-dev 2022-11-29 18:06:16 UTC
Created attachment 838083 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2022-11-29 18:06:19 UTC
Created attachment 838085 [details]
emerge-history.txt.bz2
Comment 3 Toralf Förster gentoo-dev 2022-11-29 18:06:21 UTC
Created attachment 838087 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2022-11-29 18:06:22 UTC
Created attachment 838089 [details]
etc.clang.tar.bz2
Comment 5 Toralf Förster gentoo-dev 2022-11-29 18:06:24 UTC
Created attachment 838091 [details]
etc.portage.tar.bz2
Comment 6 Toralf Förster gentoo-dev 2022-11-29 18:06:25 UTC
Created attachment 838093 [details]
logs.tar.bz2
Comment 7 Toralf Förster gentoo-dev 2022-11-29 18:06:26 UTC
Created attachment 838095 [details]
sys-devel:reflex-20221012:20221129-152755.log
Comment 8 Toralf Förster gentoo-dev 2022-11-29 18:06:27 UTC
Created attachment 838097 [details]
temp.tar.bz2
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-02-07 21:56:32 UTC
Reproduced with reflex-20230206 (to-be-pushed) with:
1. make distclean
2. ./configure
2. make --shuffle=1146935951 -j32
```
gcc -c -I. -I. -DHAVE_CONFIG_H -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=500 -DFLEXLEXER_HDR=\"`echo FlexLexer|sed 's,^,re,'`.h\" -g -O2  main.c
cp ./initscan.c scan.c
gcc -c -I. -I. -DHAVE_CONFIG_H -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=500 -DFLEXLEXER_HDR=\"`echo FlexLexer|sed 's,^,re,'`.h\" -g -O2  tblcmp.c
/bin/sh ./mkscan.sh ./flex -t -p  ./scan.l >scan.c
byacc -d ./parse.y
gcc -c -I. -I. -DHAVE_CONFIG_H -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=500 -DFLEXLEXER_HDR=\"`echo FlexLexer|sed 's,^,re,'`.h\" -g -O2  libmain.c
gcc -c -I. -I. -DHAVE_CONFIG_H -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=500 -DFLEXLEXER_HDR=\"`echo FlexLexer|sed 's,^,re,'`.h\" -g -O2  libyywrap.c
touch .bootstrap
gcc -c -I. -I. -DHAVE_CONFIG_H -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=500 -DFLEXLEXER_HDR=\"`echo FlexLexer|sed 's,^,re,'`.h\" -g -O2  nfa.c
gcc -c -I. -I. -DHAVE_CONFIG_H -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=500 -DFLEXLEXER_HDR=\"`echo FlexLexer|sed 's,^,re,'`.h\" -g -O2  gen.c
gcc -c -I. -I. -DHAVE_CONFIG_H -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=500 -DFLEXLEXER_HDR=\"`echo FlexLexer|sed 's,^,re,'`.h\" -g -O2  ecs.c
./mkscan.sh: 10: ./flex: not found
gcc -c -I. -I. -DHAVE_CONFIG_H -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=500 -DFLEXLEXER_HDR=\"`echo FlexLexer|sed 's,^,re,'`.h\" -g -O2  skel.c
gcc -c -I. -I. -DHAVE_CONFIG_H -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=500 -DFLEXLEXER_HDR=\"`echo FlexLexer|sed 's,^,re,'`.h\" -g -O2  ccl.c
gcc -c -I. -I. -DHAVE_CONFIG_H -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=500 -DFLEXLEXER_HDR=\"`echo FlexLexer|sed 's,^,re,'`.h\" -g -O2  sym.c
gcc -c -I. -I. -DHAVE_CONFIG_H -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=500 -DFLEXLEXER_HDR=\"`echo FlexLexer|sed 's,^,re,'`.h\" -g -O2  misc.c
gcc -c -I. -I. -DHAVE_CONFIG_H -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=500 -DFLEXLEXER_HDR=\"`echo FlexLexer|sed 's,^,re,'`.h\" -g -O2  dfa.c
gcc -c -I. -I. -DHAVE_CONFIG_H -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=500 -DFLEXLEXER_HDR=\"`echo FlexLexer|sed 's,^,re,'`.h\" -g -O2  scan.c
gcc -c -I. -I. -DHAVE_CONFIG_H -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=500 -DFLEXLEXER_HDR=\"`echo FlexLexer|sed 's,^,re,'`.h\" -g -O2  parse.c
gcc -c -I. -I. -DHAVE_CONFIG_H -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=500 -DFLEXLEXER_HDR=\"`echo FlexLexer|sed 's,^,re,'`.h\" -g -O2  yylex.c
ar -curvU libfl.a libmain.o libyywrap.o
a - libmain.o
a - libyywrap.o
ranlib libfl.a
gcc -g -O2 -o flex  ccl.o dfa.o ecs.o gen.o main.o misc.o nfa.o parse.o scan.o skel.o sym.o tblcmp.o yylex.o  libfl.a
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: yylex.o: warning: relocation against `yytext' in read-only section `.text'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: main.o: in function `flexinit':
/var/tmp/portage/sys-devel/reflex-20230206/work/reflex-20230206/main.c:924: undefined reference to `set_input_file'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: dfa.o: in function `ntod':
/var/tmp/portage/sys-devel/reflex-20230206/work/reflex-20230206/dfa.c:711: undefined reference to `flex_free'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/sys-devel/reflex-20230206/work/reflex-20230206/dfa.c:712: undefined reference to `flex_free'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: gen.o: in function `gentabs':
/var/tmp/portage/sys-devel/reflex-20230206/work/reflex-20230206/gen.c:940: undefined reference to `flex_free'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: gen.o: in function `make_tables':
/var/tmp/portage/sys-devel/reflex-20230206/work/reflex-20230206/gen.c:1447: undefined reference to `flexscan'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: misc.o: in function `allocate_array':
/var/tmp/portage/sys-devel/reflex-20230206/work/reflex-20230206/misc.c:107: undefined reference to `flex_alloc'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: misc.o: in function `copy_string':
/var/tmp/portage/sys-devel/reflex-20230206/work/reflex-20230206/misc.c:210: undefined reference to `flex_alloc'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: misc.o: in function `reallocate_array':
/var/tmp/portage/sys-devel/reflex-20230206/work/reflex-20230206/misc.c:827: undefined reference to `flex_realloc'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: misc.o: in function `allocate_array':
/var/tmp/portage/sys-devel/reflex-20230206/work/reflex-20230206/misc.c:107: undefined reference to `flex_alloc'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: misc.o: in function `reallocate_array':
/var/tmp/portage/sys-devel/reflex-20230206/work/reflex-20230206/misc.c:827: undefined reference to `flex_realloc'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: misc.o: in function `yy_flex_xmalloc':
/var/tmp/portage/sys-devel/reflex-20230206/work/reflex-20230206/misc.c:916: undefined reference to `flex_alloc'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: sym.o: in function `addsym':
/var/tmp/portage/sys-devel/reflex-20230206/work/reflex-20230206/sym.c:65: undefined reference to `flex_alloc'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: yylex.o: in function `yylex':
/var/tmp/portage/sys-devel/reflex-20230206/work/reflex-20230206/yylex.c:47: undefined reference to `flexscan'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: yylex.o: in function `fprintf':
/usr/include/bits/stdio2.h:79: undefined reference to `yytext'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/include/bits/stdio2.h:79: undefined reference to `yytext'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
make: *** [Makefile:130: flex] Error 1 shuffle=1146935951
```
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-02-07 22:42:10 UTC
(to be clear, don't need distclean to reproduce this, I just did it as a hack because I can only hit it rarely with `./configure && make`.)
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-02-07 22:42:39 UTC
Created attachment 850126 [details]
build with MAKEOPTS="-d --shuffle=1146935951 -j32"
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-02-07 22:44:42 UTC
Note that there's two bugs:
1. The race condition
2. mkscan.sh doesn't fail when the pipeline fails, and nothing notices it fails either, so a corrupted scan.o is generated with barely any contents, the failure happens later on when linking goes wrong:
```
$ nm scan.o
0000000000000000 n wm4.0.e19e8bb94d9c36428d25f5949bc3e9e0
0000000000000000 n wm4.stdcpredef.h.19.88fdbfd5cf6f83ed579effc3e425f09b
```

Arsen took a look and thinks the scan target should use initscan unless flex exists & is executable.
Comment 13 Larry the Git Cow gentoo-dev 2023-02-09 03:07:12 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0cd9c28600309bcce0f00078d01dc7c5c13dac4e

commit 0cd9c28600309bcce0f00078d01dc7c5c13dac4e
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-02-09 03:06:37 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-02-09 03:06:42 +0000

    sys-devel/reflex: force -j1 for now
    
    We need to report the issue upstream still.
    
    Bug: https://bugs.gentoo.org/883611
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/reflex/reflex-20230206.ebuild | 5 +++++
 1 file changed, 5 insertions(+)
Comment 14 Larry the Git Cow gentoo-dev 2023-02-09 22:53:02 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5f14870405eb92a33d12a55c38fa67ffe93b9a86

commit 5f14870405eb92a33d12a55c38fa67ffe93b9a86
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-02-09 22:45:06 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-02-09 22:52:49 +0000

    sys-devel/reflex: fix parallel build
    
    Closes: https://bugs.gentoo.org/883611
    Thanks-to: Arsen Arsenović <arsen@gentoo.org>
    Signed-off-by: Sam James <sam@gentoo.org>

 .../files/reflex-20230206-parallel-build.patch     | 54 ++++++++++++++++++++++
 sys-devel/reflex/reflex-20230206.ebuild            |  7 ++-
 2 files changed, 57 insertions(+), 4 deletions(-)
Comment 15 Larry the Git Cow gentoo-dev 2023-05-31 00:28:59 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f6d4a902041340144bba7f67ee8a2591bc6be8bc

commit f6d4a902041340144bba7f67ee8a2591bc6be8bc
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-05-31 00:14:54 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-05-31 00:22:56 +0000

    sys-devel/reflex: add 20230523
    
    Bug: https://bugs.gentoo.org/883611
    Closes: https://bugs.gentoo.org/906965
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/reflex/Manifest               |  2 ++
 sys-devel/reflex/reflex-20230523.ebuild | 22 ++++++++++++++++++++++
 2 files changed, 24 insertions(+)