Skip to content

Instantly share code, notes, and snippets.

@kmark
Created June 13, 2019 00:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmark/8cc419b99892ec8d36b3d8947b7021bb to your computer and use it in GitHub Desktop.
Save kmark/8cc419b99892ec8d36b3d8947b7021bb to your computer and use it in GitHub Desktop.
#!/bin/sh
# Rebuilds flex to avoid the following:
# flex-2.5.39: loadlocale.c:130: _nl_intern_locale_data:
# Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
# Aborted (core dumped)
# --
# Run this in your repo root after a repo sync
# Tested on Ubuntu 18.04.02 LTS
cd prebuilts/misc/linux-x86/flex
rm flex-2.5.39
tar xf flex-2.5.39.tar.gz
cd flex-2.5.39
./configure
make CFLAGS='-static' LDFLAGS='-static'
rm flex
make CFLAGS='-static' LDFLAGS='-static' flex
gcc -static -o flex ccl.o dfa.o ecs.o scanflags.o gen.o main.o misc.o nfa.o parse.o scan.o skel.o sym.o tblcmp.o yylex.o options.o scanopt.o buf.o tables.o tables_shared.o filter.o regex.o /usr/lib/x86_64-linux-gnu/libm.a
mv flex ..
cd ..
rm -rf flex-2.5.39
mv flex flex-2.5.39
./flex-2.5.39 -V
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment