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

pdns-recursos fails on mips64 #9493

Closed
neheb opened this issue Jul 16, 2019 · 16 comments
Closed

pdns-recursos fails on mips64 #9493

neheb opened this issue Jul 16, 2019 · 16 comments

Comments

@neheb
Copy link
Contributor

neheb commented Jul 16, 2019

https://downloads.openwrt.org/snapshots/faillogs/mips64_octeonplus/packages/pdns-recursor/compile.txt

@James-TR

looks like some boost detection bug.

@James-TR
Copy link
Contributor

Thanks I'll take a look into this one and get input from the developers :)

@James-TR
Copy link
Contributor

pdns-recursor 4.2.0 has been released. This may still have the same issue. We can see if it's still there or try to fix prior to bumping.

@James-TR
Copy link
Contributor

James-TR commented Jul 24, 2019

PowerDNS/pdns#7951 introduced changes to boost.m4 which fixed the detection of boost, however now it simply fails during configure instead of falsely showing boost_context as available. Does octeonplus support System V ucontexts?

Edit: The changes aren't yet in a release, and may be included in 4.2.1

@neheb
Copy link
Contributor Author

neheb commented Jul 24, 2019

It should.

@neheb
Copy link
Contributor Author

neheb commented Aug 13, 2019

I looked at this again. I can't figure it out. I'm guessing it's a boost problem.

Note that the compiler for this platform has a + in its name. This has caused issues with other packages as well. This is an example: https://github.com/openwrt/packages/blob/master/multimedia/gst1-libav/Makefile#L145

ping @ClaymorePT

@ClaymorePT
Copy link
Contributor

Ok, I have been analysing this issue. For what I can tell, this is an issue regarding the mips64 arch and the lack of support of f_context for it (f_context arch support)

As an alternative, for mips64 I could try to use u_context. It will be slower but it's an alternative.

@neheb
Copy link
Contributor Author

neheb commented Aug 26, 2019

Weird that mips is supported but not mips64.

@ClaymorePT
Copy link
Contributor

I also thought that, but its what the documentation sugests :/

@ClaymorePT
Copy link
Contributor

ClaymorePT commented Aug 26, 2019

Ok, the fix that I suggested is a no-go.

After trying that approach, I get this when compiling pdns-recursor

libboost_context.so: undefined reference to 'getcontext' 
mtasker_fcontext.cc:157: undefined reference to `jump_fcontext'

which happens because 'getcontext' was deprecated since POSIX.1-2003 (as predicted by Boost.Context documentation). musl does not support this and as so, it is not possible to link pdns-recursor.

@neheb The best thing I can do is to disable boost.context for mips64 :/
What are your thoughts about this?

@neheb
Copy link
Contributor Author

neheb commented Aug 26, 2019

From reading the documentation again, it seems that nobody has written ASM for MIPS64. Probably because of a lack of devices.

undefined reference to 'getcontext' is weird. POSIX may deprecate it but musl does not. Then again, there is only a definition of getcontext in include/ucontext.h with no corresponding function. I guess that's what undefined reference means...

Looking at uClibc-ng, getcontext is available on all platforms supported by OpenWrt except mips64 and ARC. The latter fails compilation for a different reason: https://downloads.openwrt.org/snapshots/faillogs/arc_arc700/packages/pdns-recursor/compile.txt

glibc story is the same.

Disabling boost.context for mips64 and ARC seems correct here.

@neheb
Copy link
Contributor Author

neheb commented Aug 26, 2019

Yeah

/home/mangix/devstuff/openwrt/build_dir/target-arc_arc700_uClibc/pdns-recursor-4.2.0/mtasker_fcontext.cc:199: undefined reference to `jump_fcontext'
/home/mangix/devstuff/openwrt/staging_dir/toolchain-arc_arc700_gcc-9.2.0_uClibc/lib/gcc/arc-openwrt-linux-uclibc/9.2.0/../../../../arc-openwrt-linux-uclibc/bin/ld: /home/mangix/devstuff/openwrt/build_dir/target-arc_arc700_uClibc/pdns-recursor-4.2.0/mtasker_fcontext.cc:199: undefined reference to `jump_fcontext'
/home/mangix/devstuff/openwrt/staging_dir/toolchain-arc_arc700_gcc-9.2.0_uClibc/lib/gcc/arc-openwrt-linux-uclibc/9.2.0/../../../../arc-openwrt-linux-uclibc/bin/ld: mtasker_context.o: in function `pdns_makecontext(pdns_ucontext_t&, boost::function<void ()>&)':
/home/mangix/devstuff/openwrt/build_dir/target-arc_arc700_uClibc/pdns-recursor-4.2.0/mtasker_fcontext.cc:219: undefined reference to `make_fcontext'
/home/mangix/devstuff/openwrt/staging_dir/toolchain-arc_arc700_gcc-9.2.0_uClibc/lib/gcc/arc-openwrt-linux-uclibc/9.2.0/../../../../arc-openwrt-linux-uclibc/bin/ld: /home/mangix/devstuff/openwrt/build_dir/target-arc_arc700_uClibc/pdns-recursor-4.2.0/mtasker_fcontext.cc:219: undefined reference to `make_fcontext'
/home/mangix/devstuff/openwrt/staging_dir/toolchain-arc_arc700_gcc-9.2.0_uClibc/lib/gcc/arc-openwrt-linux-uclibc/9.2.0/../../../../arc-openwrt-linux-uclibc/bin/ld: /home/mangix/devstuff/openwrt/build_dir/target-arc_arc700_uClibc/pdns-recursor-4.2.0/mtasker_fcontext.cc:232: undefined reference to `jump_fcontext'
/home/mangix/devstuff/openwrt/staging_dir/toolchain-arc_arc700_gcc-9.2.0_uClibc/lib/gcc/arc-openwrt-linux-uclibc/9.2.0/../../../../arc-openwrt-linux-uclibc/bin/ld: /home/mangix/devstuff/openwrt/build_dir/target-arc_arc700_uClibc/pdns-recursor-4.2.0/mtasker_fcontext.cc:232: undefined reference to `jump_fcontext'
/home/mangix/devstuff/openwrt/staging_dir/toolchain-arc_arc700_gcc-9.2.0_uClibc/lib/gcc/arc-openwrt-linux-uclibc/9.2.0/../../../../arc-openwrt-linux-uclibc/bin/ld: mtasker_context.o: in function `threadWrapper':
/home/mangix/devstuff/openwrt/build_dir/target-arc_arc700_uClibc/pdns-recursor-4.2.0/mtasker_fcontext.cc:129: undefined reference to `jump_fcontext'
/home/mangix/devstuff/openwrt/staging_dir/toolchain-arc_arc700_gcc-9.2.0_uClibc/lib/gcc/arc-openwrt-linux-uclibc/9.2.0/../../../../arc-openwrt-linux-uclibc/bin/ld: /home/mangix/devstuff/openwrt/build_dir/target-arc_arc700_uClibc/pdns-recursor-4.2.0/mtasker_fcontext.cc:129: undefined reference to `jump_fcontext'
/home/mangix/devstuff/openwrt/staging_dir/toolchain-arc_arc700_gcc-9.2.0_uClibc/lib/gcc/arc-openwrt-linux-uclibc/9.2.0/../../../../arc-openwrt-linux-uclibc/bin/ld: /home/mangix/devstuff/openwrt/build_dir/target-arc_arc700_uClibc/pdns-recursor-4.2.0/mtasker_fcontext.cc:157: undefined reference to `jump_fcontext'
/home/mangix/devstuff/openwrt/staging_dir/toolchain-arc_arc700_gcc-9.2.0_uClibc/lib/gcc/arc-openwrt-linux-uclibc/9.2.0/../../../../arc-openwrt-linux-uclibc/bin/ld: mtasker_context.o:/home/mangix/devstuff/openwrt/build_dir/target-arc_arc700_uClibc/pdns-recursor-4.2.0/mtasker_fcontext.cc:157: more undefined references to `jump_fcontext' follow
collect2: error: ld returned 1 exit status
Makefile:1261: recipe for target 'pdns_recursor' failed
make[5]: *** [pdns_recursor] Error 1
make[5]: Leaving directory '/home/mangix/devstuff/openwrt/build_dir/target-arc_arc700_uClibc/pdns-recursor-4.2.0'
Makefile:1495: recipe for target 'all-recursive' failed
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory '/home/mangix/devstuff/openwrt/build_dir/target-arc_arc700_uClibc/pdns-recursor-4.2.0'
Makefile:1099: recipe for target 'all' failed
make[3]: *** [all] Error 2
make[3]: Leaving directory '/home/mangix/devstuff/openwrt/build_dir/target-arc_arc700_uClibc/pdns-recursor-4.2.0'
Makefile:62: recipe for target '/home/mangix/devstuff/openwrt/build_dir/target-arc_arc700_uClibc/pdns-recursor-4.2.0/.built' failed
make[2]: *** [/home/mangix/devstuff/openwrt/build_dir/target-arc_arc700_uClibc/pdns-recursor-4.2.0/.built] Error 2
make[2]: Leaving directory '/home/mangix/devstuff/openwrt/feeds/packages/net/pdns-recursor'
time: package/feeds/packages/pdns-recursor/compile#258.41#15.76#266.28
package/Makefile:111: recipe for target 'package/feeds/packages/pdns-recursor/compile' failed
make[1]: *** [package/feeds/packages/pdns-recursor/compile] Error 2
make[1]: Leaving directory '/home/mangix/devstuff/openwrt'
/home/mangix/devstuff/openwrt/include/toplevel.mk:216: recipe for target 'package/pdns-recursor/compile' failed

@ClaymorePT
Copy link
Contributor

ClaymorePT commented Aug 26, 2019

From reading the documentation again, it seems that nobody has written ASM for MIPS64. Probably because of a lack of devices.

Yep, I noticed that when I looked at the src/asm folder and noticed the same.
Nothing to do here :/

Disabling boost.context for mips64 and ARC seems correct here.

Doing so.

@ClaymorePT
Copy link
Contributor

Ok. I've opened a PR @ #9838 which will disable Boost.Context for arc and mips64.

@neheb neheb closed this as completed Dec 31, 2019
@neheb
Copy link
Contributor Author

neheb commented Feb 13, 2021

@ClaymorePT I see boostorg/context#92 has a bunch of mips64 code for context. Any idea about that?

@ClaymorePT
Copy link
Contributor

@neheb Are you talking about this?

@ClaymorePT
Copy link
Contributor

@neheb Ah! I see that you I've found the PR. I'm not monitoring such changes. They seem to be recent ones.

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

No branches or pull requests

3 participants