Issue 510 in webp: Undefined symbols building for Xcode simulator on M1

1,084 views
Skip to first unread message

timot… via monorail

unread,
Feb 24, 2021, 3:17:25 AM2/24/21
to webp-d...@webmproject.org
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 510 by timot...@gmail.com: Undefined symbols building for Xcode simulator on M1
https://bugs.chromium.org/p/webp/issues/detail?id=510

I was hopeful when I saw the latest version supports XCFrameworks, but I'm having issues with simulator builds still.

What steps will reproduce the problem?
1. Add WebP.xcframework to project
2. Add extension below
3. Compile for the simulator on an M1 Mac
4. Build fails with `Undefined symbol: _WebPGetInfo` and `Undefined symbol: _WebPDecodeRGBA`

What is the expected output? What do you see instead?
Successful build

What version of the product are you using? On what operating system?
1.2.0 iOS xcframework

Please provide any additional information below.

Use this extension on UIImage:

#import <WebP/decode.h>

+ (UIImage *)imageWithWebPData:(NSData *)imgData {
// Get width and height of the selected WebP image
int width = 0, height = 0;
WebPGetInfo(imgData.bytes, imgData.length, &width, &height);
//NSLog(@"Image Width: %d Height: %d", width, height);

// Decode the WebP image data into a RGBA value array
uint8_t *data = WebPDecodeRGBA(imgData.bytes, imgData.length, &width, &height);

// Construct a UIImage from the decoded RGBA value array
CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, data,
width * height * 4, free_image_data);
CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB();
CGBitmapInfo bitmapInfo = kCGBitmapByteOrderDefault |
kCGImageAlphaLast;
CGColorRenderingIntent renderingIntent = kCGRenderingIntentDefault;
CGImageRef imageRef = CGImageCreate(width, height, 8, 32, 4 * width,
colorSpaceRef, bitmapInfo, provider, NULL, YES, renderingIntent);
UIImage *result = [UIImage imageWithCGImage:imageRef];

// Clean up
CGImageRelease(imageRef);
CGColorSpaceRelease(colorSpaceRef);
CGDataProviderRelease(provider);


return result;
}

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

timot… via monorail

unread,
Feb 24, 2021, 3:21:19 AM2/24/21
to webp-d...@webmproject.org

Comment #1 on issue 510 by timot...@gmail.com: Undefined symbols building for Xcode simulator on M1
https://bugs.chromium.org/p/webp/issues/detail?id=510#c1

Undefined symbols for architecture arm64:
"_WebPGetInfo", referenced from:
+[UIImage(LQExtensions) imageWithWebPData:] in UIImage+LQ.o
"_WebPDecodeRGBA", referenced from:
+[UIImage(LQExtensions) imageWithWebPData:] in UIImage+LQ.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

jz… via monorail

unread,
Mar 13, 2021, 1:45:32 PM3/13/21
to webp-d...@webmproject.org
Updates:
Owner: jz...@google.com
Status: Accepted

Comment #2 on issue 510 by jz...@google.com: Undefined symbols building for Xcode simulator on M1
https://bugs.chromium.org/p/webp/issues/detail?id=510#c2

Thanks for the report. I think the issue is the simulator build only has i386 and x86_64 targets [1]. I didn't consider a native one for M1 when adding the xcframework build.

[1] https://chromium.googlesource.com/webm/libwebp/+/refs/tags/v1.2.0/xcframeworkbuild.sh#45

Git Watcher via monorail

unread,
Mar 15, 2021, 6:28:04 PM3/15/21
to webp-d...@webmproject.org

Comment #3 on issue 510 by Git Watcher: Undefined symbols building for Xcode simulator on M1
https://bugs.chromium.org/p/webp/issues/detail?id=510#c3

The following revision refers to this bug:
https://chromium.googlesource.com/webm/libwebp/+/25ae67b3de2ba941ff19ee0e90655b591faf048e

commit 25ae67b3de2ba941ff19ee0e90655b591faf048e
Author: James Zern <jz...@google.com>
Date: Sun Mar 14 01:42:11 2021

xcframeworkbuild.sh: add arm64 simulator target

this fixes simulator builds on an M1

Bug: webp:510
Change-Id: Ia2c81d33d9a85b432b17f22305b110ccc337b809

[modify] https://crrev.com/25ae67b3de2ba941ff19ee0e90655b591faf048e/xcframeworkbuild.sh

jz… via monorail

unread,
Mar 16, 2021, 10:20:38 PM3/16/21
to webp-d...@webmproject.org
Updates:
Labels: v1.2.1
Status: Fixed

Comment #4 on issue 510 by jz...@google.com: Undefined symbols building for Xcode simulator on M1
https://bugs.chromium.org/p/webp/issues/detail?id=510#c4

This should be fixed in the main branch now and will be picked up in the next release.
Reply all
Reply to author
Forward
0 new messages