Summary: | librtld.os: in function `_dl_start_profile': (.text+0x9444): undefined reference to `strcpy' | ||
---|---|---|---|
Product: | glibc | Reporter: | Tomas Kolda <koldat> |
Component: | build | Assignee: | Adhemerval Zanella <adhemerval.zanella> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | adhemerval.zanella, carlos, john.frankish, romain.naour |
Priority: | P2 | ||
Version: | 2.36 | ||
Target Milestone: | 2.37 | ||
Host: | Target: | ||
Build: | Last reconfirmed: |
Description
Tomas Kolda
2022-09-16 15:39:46 UTC
Sorry I meant to say "This was working for 2.35 ...." GCC used is 11.2.1_git20220219 (In reply to Tomas Kolda from comment #0) > When building glibc 2.36 I started to see "undefined reference to `strcpy'". How are you building this glibc? It looks like you might be using -Os or other instead of -O2, which is required to build all of glibc and avoid external library calls in certain parts of the loader (where we can't have relocations or external library calls). "-Os or other instead of -O2" - You are absolutely right. I am using Alpine abuild that has default "-Os". I am not sure why it worked for 2.35. Anyway, thank you so much for the hint. It resolved the problem. Not a bug. I have set CFLAGS, CPPFLAGS, CXXFLAGX to use -O2 instead of -Os. (In reply to Tomas Kolda from comment #4) > Not a bug. I have set CFLAGS, CPPFLAGS, CXXFLAGX to use -O2 instead of -Os. Ideally, we should support -Os as well. I think we should add a patch similar to the one to avoid libcalls [1] also to fix the possible strcpy call. [1] https://patchwork.sourceware.org/project/glibc/patch/20220811121909.4110665-1-adhemerval.zanella@linaro.org/ (In reply to Adhemerval Zanella from comment #5) > (In reply to Tomas Kolda from comment #4) > > Not a bug. I have set CFLAGS, CPPFLAGS, CXXFLAGX to use -O2 instead of -Os. > > Ideally, we should support -Os as well. I think we should add a patch > similar to the one to avoid libcalls [1] also to fix the possible strcpy > call. > > [1] > https://patchwork.sourceware.org/project/glibc/patch/20220811121909.4110665- > 1-adhemerval.zanella@linaro.org/ I agree. If we get this clean I'll talk to DJ about cloning the CI builder and test with -Os for pre-commit CI. Hello, (In reply to Adhemerval Zanella from comment #5) > (In reply to Tomas Kolda from comment #4) > > Not a bug. I have set CFLAGS, CPPFLAGS, CXXFLAGX to use -O2 instead of -Os. > > Ideally, we should support -Os as well. I think we should add a patch > similar to the one to avoid libcalls [1] also to fix the possible strcpy > call. > > [1] > https://patchwork.sourceware.org/project/glibc/patch/20220811121909.4110665- > 1-adhemerval.zanella@linaro.org/ We noticed this issue in the Buildroot gitlab-ci using glibc 2.36-44-g2628500f5dff1dd99c49a09b418b3b1ea3a6b5d3 [1]. Backporting the patch [2] allows to fix the issue. [1] https://gitlab.com/buildroot.org/buildroot/-/jobs/3134229956 [2] https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=9dc4e29f630c6ef8299120b275e503321dc0c8c7 Best regards, Romain |