7a14f783bd
bazel run //example:hello_world --config=clang causes a window to open and draws a circle and a square. Text to follow in a future CL. To make this work, I had to get rid of musl and use glibc. All the shared libraries (.so files) that were pre-built and available for download (e.g. from https://packages.debian.org/bullseye/amd64/libgl1/download) were compiled against glibc. When I tried to run a program statically linked with musl and dynamically linked against things using glibc, I got a segmentation fault on things like calloc(). Initial attempts to use glibc had failed because it was thought that the libc.so.6 file could only be referred to by absolute path (and thus Bazel would not be happy about it). As it turns out, that was simply a misconfiguration of the builtin_sysroot parameter to cc_common.create_cc_toolchain_config_info (see //toolchain/clang_toolchain_config.bzl). By setting that to `external/clang_linux_amd64` and not `external/clang_linux_amd64/usr`, the libc binary which had been extracted to `external/clang_linux_amd64/lib/x86_64-linux-gnu` was perfectly reachable from `external/clang_linux_amd64/usr/usr/lib/x86_64-linux-gnu/libc.so` To bring in the shared libraries to link against (e.g. X11, GL) I made build_toolchain.bzl easier to modify in that we simply need to add a debian download url and sha256 hash to a list (rather than having to plumb this through via arguments). Recommended Review Order: - example/BUILD.bazel (not sure if we always want to set bare link arguments like that or if we want to use "features" to pass those along to the toolchain). - tools/sk_app/BUILD.bazel to see initial cc_library for wrapping sk_app code. - toolchain/build_toolchain.bzl to see removal of musl and new list of debs. - toolchain/clang_toolchain_config.bzl (where use of the no-canonical-prefixes was key to compilation success). Notice also that we statically linked libc++ (I did not have any shared libraries for it locally, so I guessed a typical developer might not either). - Rest of toolchain/ for trivial renames. - bazel/Makefile to see extra docs on those targets and a new target that compiles all the exes so far for a quick way to test the build. - third_party/BUILD.bazel and src/gpu/BUILD.bazel which have non-generated changes. (all other BUILD.bazel files do). - go.mod, which needed to update the infra repo version in order to pick up http://review.skia.org/491736). Change-Id: I8687bd227353040eca2dffa9465798d8bd395027 Bug: skia:12541 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/492117 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com> |
||
---|---|---|
.. | ||
BUILD.bazel | ||
SkAnnotation.h | ||
SkBBHFactory.h | ||
SkBitmap.h | ||
SkBlender.h | ||
SkBlendMode.h | ||
SkBlurTypes.h | ||
SkCanvas.h | ||
SkCanvasVirtualEnforcer.h | ||
SkClipOp.h | ||
SkColor.h | ||
SkColorFilter.h | ||
SkColorPriv.h | ||
SkColorSpace.h | ||
SkContourMeasure.h | ||
SkCoverageMode.h | ||
SkCubicMap.h | ||
SkCustomMesh.h | ||
SkData.h | ||
SkDataTable.h | ||
SkDeferredDisplayList.h | ||
SkDeferredDisplayListRecorder.h | ||
SkDocument.h | ||
SkDrawable.h | ||
SkDrawLooper.h | ||
SkEncodedImageFormat.h | ||
SkExecutor.h | ||
SkFlattenable.h | ||
SkFont.h | ||
SkFontArguments.h | ||
SkFontMetrics.h | ||
SkFontMgr.h | ||
SkFontParameters.h | ||
SkFontStyle.h | ||
SkFontTypes.h | ||
SkGraphics.h | ||
SkICC.h | ||
SkImage.h | ||
SkImageEncoder.h | ||
SkImageFilter.h | ||
SkImageGenerator.h | ||
SkImageInfo.h | ||
SkM44.h | ||
SkMallocPixelRef.h | ||
SkMaskFilter.h | ||
SkMath.h | ||
SkMatrix.h | ||
SkMilestone.h | ||
SkOverdrawCanvas.h | ||
SkPaint.h | ||
SkPath.h | ||
SkPathBuilder.h | ||
SkPathEffect.h | ||
SkPathMeasure.h | ||
SkPathTypes.h | ||
SkPicture.h | ||
SkPictureRecorder.h | ||
SkPixelRef.h | ||
SkPixmap.h | ||
SkPngChunkReader.h | ||
SkPoint3.h | ||
SkPoint.h | ||
SkPromiseImageTexture.h | ||
SkRasterHandleAllocator.h | ||
SkRect.h | ||
SkRefCnt.h | ||
SkRegion.h | ||
SkRRect.h | ||
SkRSXform.h | ||
SkSamplingOptions.h | ||
SkScalar.h | ||
SkSerialProcs.h | ||
SkShader.h | ||
SkSize.h | ||
SkSpan.h | ||
SkStream.h | ||
SkString.h | ||
SkStringView.h | ||
SkStrokeRec.h | ||
SkSurface.h | ||
SkSurfaceCharacterization.h | ||
SkSurfaceProps.h | ||
SkSwizzle.h | ||
SkTextBlob.h | ||
SkTileMode.h | ||
SkTime.h | ||
SkTraceMemoryDump.h | ||
SkTypeface.h | ||
SkTypes.h | ||
SkUnPreMultiply.h | ||
SkVertices.h | ||
SkYUVAInfo.h | ||
SkYUVAPixmaps.h |