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

Fails to build because of hidden symbols #207

Closed
Vogtinator opened this issue Oct 16, 2018 · 5 comments
Closed

Fails to build because of hidden symbols #207

Vogtinator opened this issue Oct 16, 2018 · 5 comments

Comments

@Vogtinator
Copy link
Contributor

Vogtinator commented Oct 16, 2018

The visibility changes in as-tag.c break building:

[   88s] FAILED: src/libappstream.so.0.12.2 
[   88s] cc  -o src/libappstream.so.0.12.2 'src/src@@@appstream@sha/meson-generated_.._as-resources.c.o' 'src/src@@@appstream@sha/as-utils.c.o' 'src/src@@@appstream@sha/as-tag.c.o' 'src/src@@@appstream@sha/as-context.c.o' 'src/src@@@appstream@sha/as-xml.c.o' 'src/src@@@appstream@sha/as-yaml.c.o' 'src/src@@@appstream@sha/as-variant-cache.c.o' 'src/src@@@appstream@sha/as-desktop-entry.c.o' 'src/src@@@appstream@sha/as-distro-extras.c.o' 'src/src@@@appstream@sha/as-stemmer.c.o' 'src/src@@@appstream@sha/as-spdx.c.o' 'src/src@@@appstream@sha/as-metadata.c.o' 'src/src@@@appstream@sha/as-component.c.o' 'src/src@@@appstream@sha/as-enums.c.o' 'src/src@@@appstream@sha/as-provided.c.o' 'src/src@@@appstream@sha/as-bundle.c.o' 'src/src@@@appstream@sha/as-pool.c.o' 'src/src@@@appstream@sha/as-category.c.o' 'src/src@@@appstream@sha/as-distro-details.c.o' 'src/src@@@appstream@sha/as-screenshot.c.o' 'src/src@@@appstream@sha/as-image.c.o' 'src/src@@@appstream@sha/as-release.c.o' 'src/src@@@appstream@sha/as-checksum.c.o' 'src/src@@@appstream@sha/as-validator.c.o' 'src/src@@@appstream@sha/as-validator-issue.c.o' 'src/src@@@appstream@sha/as-icon.c.o' 'src/src@@@appstream@sha/as-translation.c.o' 'src/src@@@appstream@sha/as-suggested.c.o' 'src/src@@@appstream@sha/as-content-rating.c.o' 'src/src@@@appstream@sha/as-launchable.c.o' 'src/src@@@appstream@sha/as-relation.c.o' 'src/src@@@appstream@sha/as-agreement.c.o' 'src/src@@@appstream@sha/as-agreement-section.c.o' -Wl,--no-undefined -Wl,--as-needed -shared -fPIC -Wl,--start-group -Wl,-soname,libappstream.so.4 -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g -lglib-2.0 -Wl,--end-group -lxml2 -lyaml -lgobject-2.0 -lglib-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0  
[   88s] src/src@@@appstream@sha/as-validator.c.o: In function `as_validator_validate_component_node':
[   88s] /home/abuild/rpmbuild/BUILD/AppStream-0.12.2/build/../src/as-validator.c:1451: undefined reference to `strlen'
[   88s] src/src@@@appstream@sha/as-validator.c.o: In function `as_validator_check_description_tag':
[   88s] /home/abuild/rpmbuild/BUILD/AppStream-0.12.2/build/../src/as-validator.c:471: undefined reference to `strlen'
[   88s] src/src@@@appstream@sha/as-utils.c.o: In function `as_gstring_replace':
[   88s] /home/abuild/rpmbuild/BUILD/AppStream-0.12.2/build/../src/as-utils.c:481: undefined reference to `strlen'
[   88s] /home/abuild/rpmbuild/BUILD/AppStream-0.12.2/build/../src/as-utils.c:482: undefined reference to `strlen'
[   88s] src/src@@@appstream@sha/as-utils.c.o: In function `as_utils_search_token_valid':
[   88s] /home/abuild/rpmbuild/BUILD/AppStream-0.12.2/build/../src/as-utils.c:842: undefined reference to `strlen'
[   88s] src/src@@@appstream@sha/as-utils.c.o:/home/abuild/rpmbuild/BUILD/AppStream-0.12.2/build/../src/as-utils.c:1021: more undefined references to `strlen' follow
[   88s] src/src@@@appstream@sha/as-utils.c.o: In function `as_utils_compare_versions':
[   88s] /home/abuild/rpmbuild/BUILD/AppStream-0.12.2/build/../src/as-utils.c:1103: undefined reference to `strcmp'
[   88s] /home/abuild/rpmbuild/BUILD/AppStream-0.12.2/build/../src/as-utils.c:1093: undefined reference to `strlen'
[   88s] /home/abuild/rpmbuild/BUILD/AppStream-0.12.2/build/../src/as-utils.c:1094: undefined reference to `strlen'
[   88s] src/src@@@appstream@sha/as-tag.c.o: In function `_as_xml_tag_from_gperf':
[   88s] /home/abuild/rpmbuild/BUILD/AppStream-0.12.2/build/../src/as-tag-xml.gperf:38: undefined reference to `strcmp'
[   88s] src/src@@@appstream@sha/as-tag.c.o: In function `_as_yaml_tag_from_gperf':
[   88s] /home/abuild/rpmbuild/BUILD/AppStream-0.12.2/build/../src/as-tag-yaml.gperf:45: undefined reference to `strcmp'
[   88s] src/src@@@appstream@sha/as-tag.c.o: In function `as_xml_tag_from_string':
[   88s] /home/abuild/rpmbuild/BUILD/AppStream-0.12.2/build/../src/as-tag.c:70: undefined reference to `strlen'
[   88s] src/src@@@appstream@sha/as-tag.c.o: In function `as_yaml_tag_from_string':
[   88s] /home/abuild/rpmbuild/BUILD/AppStream-0.12.2/build/../src/as-tag.c:98: undefined reference to `strlen'
[   88s] src/src@@@appstream@sha/as-xml.c.o: In function `as_xml_add_description_node_helper':
[   88s] /home/abuild/rpmbuild/BUILD/AppStream-0.12.2/build/../src/as-xml.c:278: undefined reference to `strlen'
[   88s] src/src@@@appstream@sha/as-xml.c.o: In function `as_xml_parse_document':
[   88s] /home/abuild/rpmbuild/BUILD/AppStream-0.12.2/build/../src/as-xml.c:552: undefined reference to `strlen'
[   88s] src/src@@@appstream@sha/as-yaml.c.o: In function `as_yaml_emit_scalar':
[   88s] /home/abuild/rpmbuild/BUILD/AppStream-0.12.2/build/../src/as-yaml.c:242: undefined reference to `strlen'
[   88s] src/src@@@appstream@sha/as-yaml.c.o:/home/abuild/rpmbuild/BUILD/AppStream-0.12.2/build/../src/as-yaml.c:265: more undefined references to `strlen' follow
[   88s] collect2: error: ld returned 1 exit status
@ximion
Copy link
Owner

ximion commented Oct 16, 2018

Hmm, is there anything special about your system? The software builds fine for me, and the CI is happy as well, additionally there were no changes to as-tag for quite a while and the Debian package builds as well.
An undefined reference to strlen, strcmp etc. feels like the library isn't linked to the C standard library, which is quite odd.

@Vogtinator
Copy link
Contributor Author

It builds fine on openSUSE Tumbleweed, but fails reproducibly on Leap 15.0.

Adding #include <string.h> before the visibility changes in as-tag.c fixes this.

@ximion
Copy link
Owner

ximion commented Oct 16, 2018

Interesting. Potentially this fails with a newer GCC?
Including string.h makes sense, would you mind creating a PR for that? Otherwise I will just make that change in a few hours when I'm home.

@Vogtinator
Copy link
Contributor Author

Interesting. Potentially this fails with a newer GCC?

Older, actually. GCC 7.3.1 fails, but 8.2.1 works. It might also be binutils causing this.

Including string.h makes sense, would you mind creating a PR for that? Otherwise I will just make that change in a few hours when I'm home.

I could create a PR, but I'm not sure that it's the right solution. It's necessary because the includes with hidden default visibility include string.h, so once any include file referenced there changes, this needs to be adjusted.

@ximion ximion closed this as completed in 9252de8 Oct 20, 2018
@ximion
Copy link
Owner

ximion commented Oct 20, 2018

I think for now this is a good solution. I really don't want to have the gperf-related symbols exported, and I don't see a better way to resolve this.

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

2 participants