-
Notifications
You must be signed in to change notification settings - Fork 298
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
link error: undefined reference to `__poll_chk' #26
Comments
Most probably the 'glibc' build configuration is not fully compatible. Take a look at the latest glibc build process: https://github.com/ivandavidov/minimal/blob/master/src/04_build_glibc.sh I have disabled certain 'glibc' functionalities in order to make the build more generic. In particular, this is what I've used:
My suggestion is to edit your 'glibc' build script and add the '--without' options that you see above. Then continue with the build process and see what happens. You can also try to google the string "undefined reference to __poll_chk" and try to figure out what the actual underlying problem is. Let me know if you find solution for the issue. Regards, |
Hi, Dear Ivan Sorry for not clearly described the problem. My host machine has Ubuntu12.04 x86_64 OS installed. Gcc version is gcc-4.9. I used the lasted scripts on the GitHub and made not changes to them. I double check the build process of the glibc (04_build_glibc.sh), and all commands returned success. There was only a warning at the end of make installl of glibc: The issue happened at the link phase of the busybox when run 07_build_busybox.sh : undefined reference to __poll_chk.
I think the problem is we force the busybox linked with the glibc we just built (by set the SYSROOT variable). However, the __poll_chk function from glibc was not correctly built in. (the function is defined in glibc-xxx/debug/poll_chk.c I can get rid of the error by haking: copy poll_chk.c to the busybox folder, then compile to get poll_chk.o and add this file to the busybox link list. |
The We do need to link Currently you are in better position to research this particular issue since my host environments are OK. I use Linux Mint (x86 and x86_64) and I have no such issues there (i.e. "works on my machine"). Could you please track down the I guess you can redirect the output from the scripts in some log files and examine the logs. I've already done that in the |
I found this post: http://stackoverflow.com/questions/35362844/version-glibc-2-16-not-found-target-host-error-after-upgrading-build-environ According to the post, the __poll_chk function is only include in GLIBC_2.16. Thus, when linking against other version of glibc, there would be a problem. Further more, I check the libc.map file in my minimal/src/work/glibc/glibc-2.23/glibc_objects folder. There is a section related:
the __poll_chk only occurs in the GLIBC_2.16 section. I Intuitively felt the issue was caused by a similar problem, however I have little sense how to verify. |
OK, I'm just brainstorming here, based on the article which you've found:
Once I have some free time I'll try to reproduce the issue and analyze it further. I'd be happy if there is a permanent solution or at least a workaround which I could include in the next version of |
OK, this is what I propose: In
...with this one:
Please let me know if applying this change works for you. FYI - you can apply the same CFLAGS to the glibc build in
...with this line:
Note that in general you won't need to do the latter. In your case it should be enough to apply the BusyBox related change. EDIT - it seems like the issue is really Ubuntu specific. The |
Great. It works after I replace the make command in the 07_build_busybox.sh. So much appreciated to you |
Glad to hear the issue has been resolved. I'll include the workaround in the next MLL version. |
Hi,
I am using your script to build a minimal linux file system. However, I met the following problem when run 07_build_busybox.sh:
miscutils/lib.a(microcom.o): In function
microcom_main': microcom.c:(.text.microcom_main+0x28b): undefined reference to
__poll_chk'networking/lib.a(ifplugd.o): In function
ifplugd_main': ifplugd.c:(.text.ifplugd_main+0x318): undefined reference to
__poll_chk'runit/lib.a(runsv.o): In function
runsv_main': runsv.c:(.text.runsv_main+0x4fe): undefined reference to
__poll_chk'util-linux/lib.a(script.o): In function
script_main': script.c:(.text.script_main+0x204): undefined reference to
__poll_chk'collect2: error: ld returned 1 exit status
make: *** [busybox_unstripped] Error 1
Have you any sense what is wrong?
ps. if I did not spefic the CONFIG_SYSROOT, denote line 41 in 07_build_busybox.sh, these would be not errors.
Thanks in advance
The text was updated successfully, but these errors were encountered: