Skip to content

Commit

Permalink
[backport] package/flex: disable reallocarray
Browse files Browse the repository at this point in the history
This doesn't compile with glibc 2.26 where reallocarray() as been introduced.

It's a nasty issue, when reallocarray() is available for the target, flex will
build a small tool called stage1flex for the host (using _FOR_BUILD) but with
the config.h generated for the target.

When the host doesn't have a glibc >= 2.26, reallocarray() is never defined
while building stage1flex:

misc.c:147:8: warning : implicit declaration of function « reallocarray »
[-Wimplicit-function-declaration]
  mem = reallocarray(NULL, (size_t) size, element_size);
        ^~~~~~~~~~~~
misc.c:147:6: warning : assignment makes pointer from integer without a cast
[-Wint-conversion]
  mem = reallocarray(NULL, (size_t) size, element_size);
      ^

Disable reallocarray for now, reallocarray() support may be
enabled in a followup patch.

Fixes:
stage1flex-misc.o: In function `allocate_array':
misc.c:(.text+0x38f): undefined reference to `reallocarray'
stage1flex-misc.o: In function `reallocate_array':
misc.c:(.text+0xc8a): undefined reference to `reallocarray'
collect2: error: ld returned 1 exit status

Signed-off-by: Romain Naour <[email protected]>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <[email protected]>
  • Loading branch information
RomainNaour authored and commodo committed Feb 6, 2018
1 parent 72f3cd7 commit 8b5a1fe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package/flex/flex.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ FLEX_INSTALL_STAGING = YES
FLEX_LICENSE = FLEX
FLEX_LICENSE_FILES = COPYING
FLEX_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES) host-m4
FLEX_CONF_ENV = ac_cv_path_M4=/usr/bin/m4
FLEX_CONF_ENV = ac_cv_path_M4=/usr/bin/m4 \
ac_cv_func_reallocarray=no
HOST_FLEX_DEPENDENCIES = host-m4

define FLEX_DISABLE_PROGRAM
Expand Down

0 comments on commit 8b5a1fe

Please sign in to comment.