Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • G GLib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 862
    • Issues 862
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 41
    • Merge requests 41
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • GLib
  • Merge requests
  • !88

gio, glib, gobject: complete lib*_dep variables.

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Jehan requested to merge Jehan/glib:wip/jehan/android-master-v2 into master Jun 08, 2018
  • Overview 19
  • Commits 1
  • Pipelines 3
  • Changes 3

This fixes building glib for Android where builds were failing with various 'undefined reference' errors.

This is an alternative fix to !87 (closed), and most likely a better one.

To give a little more details, without my commit, here is the kind of errors I was getting:

[6/663] Linking target glib/tests/asyncqueue.
FAILED: glib/tests/asyncqueue 
aarch64-linux-android-gcc  -o glib/tests/asyncqueue 'glib/tests/glib@tests@@asyncqueue@exe/asyncqueue.c.o' -Wl,--no-undefined -Wl,--as-needed -Wl,--start-group glib/libglib-2.0.so -pthread -lm -lintl -Wl,--end-group '-Wl,-rpath,$ORIGIN/..' -Wl,-rpath-link,/opt/user-cache/jehan/dev/crossbuild/android-arm64/glib/glib  
/home/jehan/.cache/crossroad/android/toolchain/android-22-arm64/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld: warning: libiconv.so, needed by glib/libglib-2.0.so, not found (try using -rpath or -rpath-link)
glib/libglib-2.0.so: undefined reference to `libiconv'
glib/libglib-2.0.so: undefined reference to `libiconv_open'
glib/libglib-2.0.so: undefined reference to `libiconv_close'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

As we can see, the problem was that glib/tests/asyncqueue was linked with libglib which itself had some references to libiconv, but libiconv itelf was not on the command line. This actually makes sense, since in glib/meson.build, libglib is indeed linked with libiconv but libglib_dep does not declare it as a dependency. This is probably the source error.

My previous MR !87 (closed) was fixing the consequences, whereas this new MR instead fixes directly libglib_dep by declaring correctly libiconv in the dependency list. It also does the same for libgio_dep and libgobject_dep.

I have no idea why you don't get the errors in your CI runner, but with this new fix, we clearly see the source of the issue and the fact that these link flags are definitely the right way (even though in some cases, apparently it works also without).

For the record also, I configure with -Diconv=gnu for Android.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: wip/jehan/android-master-v2