Skip to content

php8: fixup libiconv usage (refs openwrt/openwrt#10024)#18919

Merged
mhei merged 1 commit intoopenwrt:masterfrom
mhei:php8-full-libiconv
Jul 19, 2022
Merged

php8: fixup libiconv usage (refs openwrt/openwrt#10024)#18919
mhei merged 1 commit intoopenwrt:masterfrom
mhei:php8-full-libiconv

Conversation

@mhei
Copy link
Copy Markdown
Member

@mhei mhei commented Jul 12, 2022

Maintainer: me
Compile tested: mxs
Run tested: mxs

Description:

Since the OpenWrt's stub libiconv implementation is now gone,
we can build against musl's internal one or the external libiconv
implementation.
This needs minor adjustements in the makefile to allow PHPs build
to choose the right path when cross-compiling.

Signed-off-by: Michael Heimpold mhei@heimpold.de

Edit: updated description to reflect new approach

@mhei mhei requested a review from neheb July 12, 2022 22:00
@mhei mhei self-assigned this Jul 12, 2022
@mhei mhei marked this pull request as ready for review July 12, 2022 22:01
@neheb
Copy link
Copy Markdown
Contributor

neheb commented Jul 12, 2022

weird that php doesn't support the builtin one. Anyway, looks like it compiles.

@mhei
Copy link
Copy Markdown
Member Author

mhei commented Jul 12, 2022

For

# CONFIG_BUILD_NLS is not set
CONFIG_LIBC="musl"

I get

/srv/openwrt/openwrt-2.git/build_dir/target-arm_arm926ej-s_musl_eabi/php-8.1.7/ext/iconv/iconv.c:197:25: error: '_libiconv_version' undeclared (first use in this function)
  197 |                         _libiconv_version >> 8, _libiconv_version & 0xff);
      |                         ^~~~~~~~~~~~~~~~~
/srv/openwrt/openwrt-2.git/build_dir/target-arm_arm926ej-s_musl_eabi/php-8.1.7/ext/iconv/iconv.c:197:25: note: each undeclared identifier is reported only once for each function it appears in
Makefile:672: recipe for target 'ext/iconv/iconv.lo' failed
make[3]: *** [ext/iconv/iconv.lo] Error 1

@neheb
Copy link
Copy Markdown
Contributor

neheb commented Jul 12, 2022

nls.mk has include in CFLAGS

@micmac1
Copy link
Copy Markdown
Contributor

micmac1 commented Jul 14, 2022

Hi @mhei

Do you still have remnants of libiconv-stub in $(STAGING_DIR)/usr/lib/libiconv-stub/{include,lib}? If yes I'd suggest to remove them and compile php8 again.

Kind regards,
Seb

@mhei
Copy link
Copy Markdown
Member Author

mhei commented Jul 14, 2022

I don't have the stub around anymore. But I think I found the problem, runtime-testing needed, but not today anymore... downgrading to draft for now.

@mhei mhei marked this pull request as draft July 14, 2022 20:56
@neheb
Copy link
Copy Markdown
Contributor

neheb commented Jul 14, 2022

In any case, I compile tested locally with CONFIG_ALL +- CONFIG_BUILD_NLS. Everything relevant compiles.

@neheb
Copy link
Copy Markdown
Contributor

neheb commented Jul 15, 2022

nls.mk changes were merged.

Since the OpenWrt's stub libiconv implementation is now gone,
we can build against musl's internal one or the external libiconv
implementation.
This needs minor adjustements in the makefile to allow PHPs build
to choose the right path when cross-compiling.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
@mhei mhei force-pushed the php8-full-libiconv branch from 98fef18 to a24a767 Compare July 17, 2022 22:04
@mhei mhei changed the title php8: switch to libiconv-full (refs openwrt/openwrt#10024) php8: fixup libiconv usage (refs openwrt/openwrt#10024) Jul 17, 2022
@mhei mhei marked this pull request as ready for review July 17, 2022 22:14
@mhei
Copy link
Copy Markdown
Member Author

mhei commented Jul 17, 2022

I've updated title and description. Actually, it is possible to link PHP against the musl iconv and I've also run-time tested. I've also rebased this PR.

@neheb
Copy link
Copy Markdown
Contributor

neheb commented Jul 17, 2022

Excellent news.

@micmac1
Copy link
Copy Markdown
Contributor

micmac1 commented Jul 17, 2022 via email

@neheb
Copy link
Copy Markdown
Contributor

neheb commented Jul 17, 2022

Unknown package 'php8-cgi'.

strange.

@mhei
Copy link
Copy Markdown
Member Author

mhei commented Jul 19, 2022

Looks like CI hiccup.

@mhei mhei merged commit 61b31a3 into openwrt:master Jul 19, 2022
@mhei mhei deleted the php8-full-libiconv branch July 19, 2022 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants