Opened 4 weeks ago

Last modified 2 weeks ago

#70609 assigned defect

perl5.34 fails to build on riscv64: undefined reference to `libintl_textdomain'

Reported by: barracuda156 Owned by: mojca (Mojca Miklavec)
Priority: Normal Milestone:
Component: ports Version: 2.10.0
Keywords: linux, riscv64 Cc:
Port: perl5.34

Description

/usr/bin/clang -L/opt/local/lib -Wl,--enable-new-dtags -Wl,-rpath,/opt/local/lib -fstack-protector-strong -o miniperl \
    opmini.o perlmini.o  gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro_core.o keywords.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o globals.o perlio.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o caretx.o dquote.o time64.o  miniperlmain.o  -lpthread -ldl -lm -lutil -lc 
/usr/bin/riscv64-pine64-linux-ld: locale.o: in function `.LBB1_125':
locale.c:(.text+0x83c): undefined reference to `libintl_textdomain'
/usr/bin/riscv64-pine64-linux-ld: locale.c:(.text+0x844): undefined reference to `libintl_textdomain'
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [makefile:363: lib/buildcustomize.pl] Error 1
make: *** Waiting for unfinished jobs....
390 warnings generated.

Any idea how to fix this?

Change History (6)

comment:1 Changed 4 weeks ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to mojca
Status: newassigned

I don't see -lintl on the line that invokes clang as a linker. That would be required to link with the libintl library that contains that symbol. If you attach the main.log file maybe it will provide insight into why that flag was omitted though of course as you know we have no experience building anything on Linux. Do you have the gettext and gettext-runtime ports installed? The perl5.34 port doesn't declare a build dependency on gettext nor a library dependency on gettext-runtime so I guess it was not expected that it would use them, and it doesn't seem to use them on macOS.

Here is an upstream bug report matching yours: https://github.com/Perl/perl5/issues/18467

comment:2 Changed 4 weeks ago by ryandesign (Ryan Carsten Schmidt)

comment:3 in reply to:  2 Changed 4 weeks ago by barracuda156

Replying to ryandesign:

You could try this patch: https://lore.kernel.org/r/all/20210221174549.3764415-1-fontaine.fabrice@gmail.com/T/

Thank you, I will try that.

Yes, I do have gettext installed by now, but something easily can be missing. This should not be considered a bug report against MacPorts, I just did not know what to do about that error. (We can’t file proper bug reports for non-MacOS systems at the moment, since unmodified MacPorts won’t even build.)

comment:4 Changed 3 weeks ago by barracuda156

Interestingly, this error happens with perl5.34 and perl5.32, but not with perl5.30 and perl5.28.

comment:5 in reply to:  1 Changed 3 weeks ago by barracuda156

Replying to ryandesign:

I don't see -lintl on the line that invokes clang as a linker. That would be required to link with the libintl library that contains that symbol. If you attach the main.log file maybe it will provide insight into why that flag was omitted though of course as you know we have no experience building anything on Linux. Do you have the gettext and gettext-runtime ports installed? The perl5.34 port doesn't declare a build dependency on gettext nor a library dependency on gettext-runtime so I guess it was not expected that it would use them, and it doesn't seem to use them on macOS.

Here is an upstream bug report matching yours: https://github.com/Perl/perl5/issues/18467

How do I pass flags to perl? It seems to ignore standard ways of doing it.

Version 0, edited 3 weeks ago by barracuda156 (next)

comment:6 Changed 2 weeks ago by barracuda156

Turns out, it conflicts with gettext libraries (build-time).

Note: See TracTickets for help on using tickets.