Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest main tries to link f(un)lockfile even with FMT_OS OFF #4189

Closed
glebm opened this issue Oct 5, 2024 · 5 comments
Closed

Latest main tries to link f(un)lockfile even with FMT_OS OFF #4189

glebm opened this issue Oct 5, 2024 · 5 comments
Labels

Comments

@glebm
Copy link
Contributor

glebm commented Oct 5, 2024

I've tried updating libfmt to the latest git (diasurgical/devilutionX#7457) and it appears the current version attempts to link f(un)lockfile even with set(FMT_OS OFF).

https://github.com/diasurgical/devilutionX/actions/runs/11191322109/job/31114078447?pr=7457

 /opt/devkitpro/devkitARM/bin/../lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/bin/ld: /tmp/ccd8bZAp.ltrans51.ltrans.o: in function `fmt::v11::vprint(__sFILE*, fmt::v11::basic_string_view<char>, fmt::v11::basic_format_args<fmt::v11::context>) [clone .constprop.0]':
/__w/devilutionX/devilutionX/build/_deps/libfmt-src/include/fmt/format-inl.h:1679:(.text._ZN3fmt3v116vprintEP7__sFILENS0_17basic_string_viewIcEENS0_17basic_format_argsINS0_7contextEEE.constprop.0+0x30): undefined reference to `flockfile'
/opt/devkitpro/devkitARM/bin/../lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/bin/ld: /__w/devilutionX/devilutionX/build/_deps/libfmt-src/include/fmt/format-inl.h:1688:(.text._ZN3fmt3v116vprintEP7__sFILENS0_17basic_string_viewIcEENS0_17basic_format_argsINS0_7contextEEE.constprop.0+0xc4): undefined reference to `funlockfile'
/opt/devkitpro/devkitARM/bin/../lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/bin/ld: /tmp/ccd8bZAp.ltrans51.ltrans.o:/__w/devilutionX/devilutionX/build/_deps/libfmt-src/include/fmt/format-inl.h:1688:(.text._ZN3fmt3v116vprintEP7__sFILENS0_17basic_string_viewIcEENS0_17basic_format_argsINS0_7contextEEE.constprop.0+0xe4): undefined reference to `funlockfile'
@glebm glebm changed the title Latest main tries to link f(un)lockfile with FMT_OS OFF Latest main tries to link f(un)lockfile even with FMT_OS OFF Oct 5, 2024
@glebm
Copy link
Contributor Author

glebm commented Oct 5, 2024

Looks like there was a similar issue previously (#4054) that got fixed and has now regressed.

Perhaps the detection mechanism broke.

@glebm
Copy link
Contributor Author

glebm commented Oct 5, 2024

It is also possible that something broke in the open-sources SDKs but it is a bit unusual that it would change in 3 of them:

image

Version 92227c7 still builds and links OK

@glebm
Copy link
Contributor Author

glebm commented Oct 5, 2024

Bisecting..

@glebm
Copy link
Contributor Author

glebm commented Oct 5, 2024

439b6d7 is the first bad commit

commit 439b6d7212d588bc4be890c17f50d4cbf19233a6
Author: Victor Zverovich <[email protected]>
Date:   Sun Jul 21 08:05:07 2024 -0700

    Reenable print optimization

 include/fmt/format-inl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

@glebm
Copy link
Contributor Author

glebm commented Oct 5, 2024

Looks like these platforms declare but do not define f(un)lockfile, which is incorrect.

Worked around with:

if(NINTENDO_3DS OR NINTENDO_SWITCH OR VITA)
  target_compile_definitions(fmt PUBLIC FMT_USE_FALLBACK_FILE=1)
endif()

@glebm glebm closed this as completed Oct 5, 2024
@vitaut vitaut added the question label Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants