You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
I tracked down the issue with the Linux GCC build: the linux-x86_64/geojsonvt/1.1.0 mason binary was built with clang-3.5, and is incompatible with mapbox-gl-native compiled under g++-4.9.
Building both libraries with g++-4.9 works fine, as does building both libraries with clang-3.5, but mixing generates mismatched symbols.
@TheMarex suggested that this change in GCC 4.9 could be responsible:
When using a linker plugin, compiling with the -flto option now generates slim object files (.o) which only contain intermediate language representation for LTO. Use -ffat-lto-objects to create files which contain additionally the object code. To generate static libraries suitable for LTO processing, use gcc-ar and gcc-ranlib; to list symbols from a slim object file use gcc-nm. (This requires that ar, ranlib and nm have been compiled with plugin support.) https://gcc.gnu.org/gcc-4.9/changes.html
Re. LTO: GCC dumps a different intermediate format than Clang (which is LLVM IR, you can even link those modules using llvm-link).
More importantly, mixing compilers is a bad idea and will not work. Even mixing different versions of the same compiler normally won't work, but for that you can read the changelog about ABI breakage. Mixing stdlibs is worse, and mixing libraries that were compiled with different C++ standard (e.g. 98 and 11) also wont work (example: copy on write string implementations were basically forbidden with latest standards).
Tested locally (and now passing on Travis too), fcb8f0d is 👍 as a workaround to just build geojsonvt from source rather than look for a mason binary. I'm sure somebody more familiar with shell scripting could clean this up a bit.
I tracked down the issue with the Linux GCC build: the linux-x86_64/geojsonvt/1.1.0 mason binary was built with clang-3.5, and is incompatible with mapbox-gl-native compiled under g++-4.9.
Building both libraries with g++-4.9 works fine, as does building both libraries with clang-3.5, but mixing generates mismatched symbols.
Reading back here... To clarify: this issue has nothing to do with LTO. It certainly could, but in this case LTO (-flto) is not a flag that be being used for mgbl or geojson-vt. Also it does not represent a conflict between libstdc++ and libc++ since only libstdc++ is used (both both clang++ and g++ on linux are using libstdc++ in this case).
So that leaves possible culprits as:
Different libstdc++ versions linked for the mason pre-compiled geojson-vt binary vs the mgbl build (unlikely)
Activity
[-]Fix npm build from source[/-][+]Fix npm install from source[/+]incanus commentedon Sep 2, 2015
Refs also #2226 (keep in mind the date there).
jfirebaugh commentedon Sep 2, 2015
npm install mapbox-gl-nativeshould not require styles or tests so those should actually be irrelevant.lucaswoj commentedon Sep 2, 2015
@jfirebaugh Ok! Modified the original issue. Omitting those should somewhat simplify the task.
mikemorris commentedon Sep 2, 2015
Moving from submodules to
node_modulesrefs #1358mikemorris commentedon Sep 4, 2015
I tracked down the issue with the Linux GCC build: the
linux-x86_64/geojsonvt/1.1.0mason binary was built with clang-3.5, and is incompatible with mapbox-gl-native compiled underg++-4.9.Building both libraries with
g++-4.9works fine, as does building both libraries withclang-3.5, but mixing generates mismatched symbols.@TheMarex suggested that this change in GCC 4.9 could be responsible:
Suggestions @springmeyer @kkaefer?
daniel-j-h commentedon Sep 4, 2015
Capturing from chat:
Re. LTO: GCC dumps a different intermediate format than Clang (which is LLVM IR, you can even link those modules using
llvm-link).More importantly, mixing compilers is a bad idea and will not work. Even mixing different versions of the same compiler normally won't work, but for that you can read the changelog about ABI breakage. Mixing stdlibs is worse, and mixing libraries that were compiled with different C++ standard (e.g. 98 and 11) also wont work (example: copy on write string implementations were basically forbidden with latest standards).
Sounds a bit harsh? :P
mikemorris commentedon Sep 4, 2015
Tested locally (and now passing on Travis too), fcb8f0d is 👍 as a workaround to just build
geojsonvtfrom source rather than look for a mason binary. I'm sure somebody more familiar with shell scripting could clean this up a bit.jfirebaugh commentedon Sep 8, 2015
@springmeyer Thoughts on how C++ stdlib conflicts should be handled with mason?
springmeyer commentedon Oct 2, 2015
Reading back here... To clarify: this issue has nothing to do with LTO. It certainly could, but in this case LTO (
-flto) is not a flag that be being used formgblorgeojson-vt. Also it does not represent a conflict betweenlibstdc++andlibc++since onlylibstdc++is used (both both clang++ and g++ on linux are usinglibstdc++in this case).So that leaves possible culprits as:
libstdc++versions linked for the mason pre-compiledgeojson-vtbinary vs themgblbuild (unlikely)clang++-3.5(used to compile geojson-vt in mason: https://github.com/mapbox/mason/blob/geojsonvt-1.1.0/.travis.yml#L12) vs g++-4.9 due to fundamental differences in those compilers (I'm doubtful)@jfirebaugh helped me dig up the actual linking error which was:
Which occurred when
using g++-4.9 to link mapbox-gl-native against libgeojsonvt.a built with clang-3.5per @mikemorrisNext actions:
libstdc++versions are being used on mason compile runs vs mgbl travis runsmikemorris commentedon Oct 2, 2015
libstdc++-20141104(date is version from__GLIBCXX__) is being used onclang-3.5andgcc-4.9mason Linux builds ofgeojsonvt-2.1.6.1libc++-1(1 being_LIBCPP_ABI_VERSION, this seemed sufficient instead of_LIBCPP_VERSIONhttp://sourceforge.net/p/predef/wiki/Libraries/)Linux and OS X builds of MBGL are using the same respective stdlibs in every case.
mikemorris commentedon Oct 2, 2015
Replicated the
g++-4.9linker error in #2489https://travis-ci.org/mapbox/mapbox-gl-native/jobs/83385446