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

Link failure for iOS with GluonFX Maven plugin 1.0.24 + GraalVM gluon-23+25.1-dev #1290

Open
salmonb opened this issue Oct 18, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@salmonb
Copy link

salmonb commented Oct 18, 2024

I have a JavaFX app that successfully compiles with GluonFX Maven plugin 1.023 + GraalVM gluon-22.1.0.1-Final + Gluon Attach 4.0.20.

I'm trying to upgrade to GluonFX Maven plugin 1.0.24 + GraalVM gluon-23+25.1-dev + Gluon Attach 4.0.20 or 4.0.21.

The compile task succeeds but the link task is failing.

Expected Behavior

Successful link task.

Current Behavior

Here is the content of the link log file with Gluon Attach 4.0.20:

Process
=======
link

Command Line
============
clang /Users/bruno/IdeaProjects/kbs3-aggregate/kbs3/kbs-frontoffice-application-gluon/target/gluonfx/arm64-ios/gvm/KbsFrontoffice/dummy.o /Users/bruno/IdeaProjects/kbs3-aggregate/kbs3/kbs-frontoffice-application-gluon/target/gluonfx/arm64-ios/gvm/KbsFrontoffice/AppDelegate.o /Users/bruno/IdeaProjects/kbs3-aggregate/kbs3/kbs-frontoffice-application-gluon/target/gluonfx/arm64-ios/gvm/KbsFrontoffice/JvmFuncsFallbacks.o /Users/bruno/IdeaProjects/kbs3-aggregate/kbs3/kbs-frontoffice-application-gluon/target/gluonfx/arm64-ios/gvm/tmp/SVM-1729196497834/dev.webfx.platform.boot.applicationbooter.o -lvmone -lstdc++ -w -fPIC -arch arm64 -mios-version-min=11.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.2.sdk -Wl,-force_load,/Users/bruno/.gluon/substrate/javafxStaticSdk/24-ea+7.1/ios-arm64/sdk/lib/libprism_es2.a -Wl,-force_load,/Users/bruno/.gluon/substrate/javafxStaticSdk/24-ea+7.1/ios-arm64/sdk/lib/libglass.a -Wl,-force_load,/Users/bruno/.gluon/substrate/javafxStaticSdk/24-ea+7.1/ios-arm64/sdk/lib/libjavafx_font.a -Wl,-force_load,/Users/bruno/.gluon/substrate/javafxStaticSdk/24-ea+7.1/ios-arm64/sdk/lib/libprism_common.a -Wl,-force_load,/Users/bruno/.gluon/substrate/javafxStaticSdk/24-ea+7.1/ios-arm64/sdk/lib/libjavafx_iio.a -Wl,-force_load,/Users/bruno/.gluon/substrate/javafxStaticSdk/24-ea+7.1/ios-arm64/sdk/lib/libwebview.a -lpthread -lz -Wl,-framework,Foundation -Wl,-framework,UIKit -Wl,-framework,CoreGraphics -Wl,-framework,MobileCoreServices -Wl,-framework,OpenGLES -Wl,-framework,CoreText -Wl,-framework,QuartzCore -Wl,-framework,ImageIO -Wl,-framework,CoreBluetooth -Wl,-framework,CoreImage -Wl,-framework,CoreLocation -Wl,-framework,CoreMedia -Wl,-framework,CoreMotion -Wl,-framework,CoreVideo -Wl,-framework,Accelerate -Wl,-framework,AVFoundation -Wl,-framework,AudioToolbox -Wl,-framework,MediaPlayer -Wl,-framework,UserNotifications -Wl,-framework,ARKit -Wl,-framework,AVKit -Wl,-framework,SceneKit -Wl,-framework,StoreKit -Wl,-framework,ModelIO -Wl,-framework,WebKit -o /Users/bruno/IdeaProjects/kbs3-aggregate/kbs3/kbs-frontoffice-application-gluon/target/gluonfx/arm64-ios/KbsFrontoffice.app/KbsFrontoffice -L/Users/bruno/.gluon/substrate/javafxStaticSdk/24-ea+7.1/ios-arm64/sdk/lib -L/Users/bruno/.gluon/substrate/javaStaticSdk/24-2/ios-arm64/lib -L/Users/bruno/IdeaProjects/kbs3-aggregate/kbs3/kbs-frontoffice-application-gluon/target/gluonfx/arm64-ios/gvm/lib -Wl,-force_load,/Users/bruno/IdeaProjects/kbs3-aggregate/kbs3/kbs-frontoffice-application-gluon/target/gluonfx/arm64-ios/gvm/lib/libAudio.a -Wl,-force_load,/Users/bruno/IdeaProjects/kbs3-aggregate/kbs3/kbs-frontoffice-application-gluon/target/gluonfx/arm64-ios/gvm/lib/libLifecycle.a -Wl,-force_load,/Users/bruno/IdeaProjects/kbs3-aggregate/kbs3/kbs-frontoffice-application-gluon/target/gluonfx/arm64-ios/gvm/lib/libBrowser.a -Wl,-force_load,/Users/bruno/IdeaProjects/kbs3-aggregate/kbs3/kbs-frontoffice-application-gluon/target/gluonfx/arm64-ios/gvm/lib/libUtil.a -Wl,-force_load,/Users/bruno/IdeaProjects/kbs3-aggregate/kbs3/kbs-frontoffice-application-gluon/target/gluonfx/arm64-ios/gvm/lib/libStorage.a

Output
======
Undefined symbols for architecture arm64:
  "_objc_msgSend$ApplicationClass", referenced from:
      +[GlassHelper ApplicationNotifyWillBecomeActiveMethod] in libglass.a(GlassHelper.obj)
      +[GlassHelper ApplicationNotifyDidBecomeActiveMethod] in libglass.a(GlassHelper.obj)
      +[GlassHelper ApplicationNotifyWillResignActiveMethod] in libglass.a(GlassHelper.obj)
      +[GlassHelper ApplicationNotifyDidResignActiveMethod] in libglass.a(GlassHelper.obj)
      +[GlassHelper ApplicationNotifyDidReceiveMemoryWarningMethod] in libglass.a(GlassHelper.obj)
      +[GlassHelper ApplicationNotifyWillQuitMethod] in libglass.a(GlassHelper.obj)
  "_objc_msgSend$ApplicationNotifyDidBecomeActiveMethod", referenced from:
      -[GlassApplication callDidBecomeActive] in libglass.a(GlassApplication.obj)
  "_objc_msgSend$ApplicationNotifyDidReceiveMemoryWarningMethod", referenced from:
      -[GlassApplication callDidReceiveMemoryWarning] in libglass.a(GlassApplication.obj)
  "_objc_msgSend$ApplicationNotifyDidResignActiveMethod", referenced from:
      -[GlassApplication callDidResignActive] in libglass.a(GlassApplication.obj)
  "_objc_msgSend$ApplicationNotifyWillBecomeActiveMethod", referenced from:
      -[GlassApplication callWillBecomeActive] in libglass.a(GlassApplication.obj)
  "_objc_msgSend$ApplicationNotifyWillQuitMethod", referenced from:
      -[GlassApplication callQuit] in libglass.a(GlassApplication.obj)
  "_objc_msgSend$ApplicationNotifyWillResignActiveMethod", referenced from:
      -[GlassApplication callWillResignActive] in libglass.a(GlassApplication.obj)
  "_objc_msgSend$CGColor", referenced from:
      -[GlassViewGL requestInput:type:width:height:mxx:mxy:mxz:mxt:myx:myy:myz:myt:mzx:mzy:mzz:mzt:] in libglass.a(GlassViewGL.obj)
      -[GlassViewGL setUpLayerForText:] in libglass.a(GlassViewGL.obj)
  "_objc_msgSend$CGImage", referenced from:
      _Java_com_sun_glass_ui_ios_IosPasteboard__1getItemAsRawImage in libglass.a(GlassPasteboard.obj)
  "_objc_msgSend$ClassForName:withEnv:", referenced from:
      -[GlassApplication runLoop:] in libglass.a(GlassApplication.obj)
      +[GlassHelper ApplicationClass] in libglass.a(GlassHelper.obj)
      -[GlassViewDelegate initWithView:withJview:] in libglass.a(GlassViewDelegate.obj)
  "_objc_msgSend$GlassApplicationDidChangeScreenParameters", referenced from:
      -[GlassViewController didRotateFromInterfaceOrientation:] in libglass.a(GlassViewController.obj)
  "_objc_msgSend$URL", referenced from:
      -[WebViewImpl loadUrl:] in libwebview.a(WebViewImpl.obj)
      -[WebViewImpl webView:decidePolicyForNavigationAction:decisionHandler:] in libwebview.a(WebViewImpl.obj)
      ___43-[WebViewImpl webView:didFinishNavigation:]_block_invoke in libwebview.a(WebViewImpl.obj)
  "_objc_msgSend$URLWithString:", referenced from:
      _Java_com_sun_glass_ui_ios_IosPasteboard__1getItemAsString in libglass.a(GlassPasteboard.obj)
      -[ImageLoader loadFromURL:JNIEnv:] in libjavafx_iio.a(ImageLoader.obj)
      -[WebViewImpl loadUrl:] in libwebview.a(WebViewImpl.obj)
  "_objc_msgSend$UTF8String", referenced from:
      _Java_com_sun_glass_ui_ios_IosPasteboard__1getName in libglass.a(GlassPasteboard.obj)
      _Java_com_sun_glass_ui_ios_IosPasteboard__1getUTFs in libglass.a(GlassPasteboard.obj)
      _Java_com_sun_glass_ui_ios_IosPasteboard__1getItemAsString in libglass.a(GlassPasteboard.obj)
      _Java_com_sun_glass_ui_ios_IosPasteboard__1getItemStringForUTF in libglass.a(GlassPasteboard.obj)
      -[GlassWindow insertText:] in libglass.a(GlassWindow.obj)
      -[ImageLoader loadFromURL:JNIEnv:] in libjavafx_iio.a(ImageLoader.obj)
      _createJString in libwebview.a(WebViewImpl.obj)
      ...
  "_objc_msgSend$_constrainBounds:", referenced from:
      -[GlassWindow _setBoundsAndPosition] in libglass.a(GlassWindow.obj)
  "_objc_msgSend$_grabFocus", referenced from:
      _Java_com_sun_glass_ui_ios_IosWindow__1grabFocus in libglass.a(GlassWindow.obj)
  "_objc_msgSend$_orderBack", referenced from:
      -[GlassWindow orderBack] in libglass.a(GlassWindow.obj)
  "_objc_msgSend$_orderFrontRegardless", referenced from:
      -[GlassWindow orderFrontRegardless] in libglass.a(GlassWindow.obj)
  "_objc_msgSend$_resetGrab", referenced from:
      -[GlassWindow _checkUngrab] in libglass.a(GlassWindow.obj)
      -[GlassWindow _grabFocus] in libglass.a(GlassWindow.obj)
  "_objc_msgSend$_sendJavaWindowMoveEventForFrame:", referenced from:
      -[GlassWindow setCenter:] in libglass.a(GlassWindow.obj)
      _Java_com_sun_glass_ui_ios_IosWindow__1setBounds in libglass.a(GlassWindow.obj)
  "_objc_msgSend$_sendJavaWindowResizeEvent:forFrame:", referenced from:
      -[GlassWindow setBounds:] in libglass.a(GlassWindow.obj)
      -[GlassWindow _setMinimumSize] in libglass.a(GlassWindow.obj)
      -[GlassWindow _setMaximumSize] in libglass.a(GlassWindow.obj)
      _Java_com_sun_glass_ui_ios_IosWindow__1setBounds in libglass.a(GlassWindow.obj)
  "_objc_msgSend$_setAlpha", referenced from:
      _Java_com_sun_glass_ui_ios_IosWindow__1setAlpha in libglass.a(GlassWindow.obj)
  "_objc_msgSend$_setBounds", referenced from:
      -[GlassViewGL setFrame:] in libglass.a(GlassViewGL.obj)
  "_objc_msgSend$_setBoundsAndPosition", referenced from:
      -[GlassWindow _setMinimumSize] in libglass.a(GlassWindow.obj)
      -[GlassWindow _setMaximumSize] in libglass.a(GlassWindow.obj)
      -[GlassWindow addChildWindow:] in libglass.a(GlassWindow.obj)
      _setWindowFrame in libglass.a(GlassWindow.obj)
  "_objc_msgSend$_setLevel", referenced from:
      _Java_com_sun_glass_ui_ios_IosWindow__1setLevel in libglass.a(GlassWindow.obj)
  "_objc_msgSend$_setMaximumSize", referenced from:
      _Java_com_sun_glass_ui_ios_IosWindow__1setMaximumSize in libglass.a(GlassWindow.obj)
  "_objc_msgSend$_setMinimumSize", referenced from:
      _Java_com_sun_glass_ui_ios_IosWindow__1setMinimumSize in libglass.a(GlassWindow.obj)
  "_objc_msgSend$_setTransparent:", referenced from:
      -[GlassWindow initWithScreen:jwindow:] in libglass.a(GlassWindow.obj)
      __1createWindow in libglass.a(GlassWindow.obj)
  "_objc_msgSend$_setVisible", referenced from:
      _Java_com_sun_glass_ui_ios_IosWindow__1setVisible in libglass.a(GlassWindow.obj)
  "_objc_msgSend$_ungrabFocus", referenced from:
      -[GlassWindow close] in libglass.a(GlassWindow.obj)
      +[GlassWindow _resetGrab] in libglass.a(GlassWindow.obj)
      -[GlassWindow resignKeyWindow] in libglass.a(GlassWindow.obj)
      _Java_com_sun_glass_ui_ios_IosWindow__1setVisible in libglass.a(GlassWindow.obj)
      _Java_com_sun_glass_ui_ios_IosWindow__1ungrabFocus in libglass.a(GlassWindow.obj)
  "_objc_msgSend$absoluteString", referenced from:
      -[WebViewImpl loadUrl:] in libwebview.a(WebViewImpl.obj)
      -[WebViewImpl webView:decidePolicyForNavigationAction:decisionHandler:] in libwebview.a(WebViewImpl.obj)
      ___43-[WebViewImpl webView:didFinishNavigation:]_block_invoke in libwebview.a(WebViewImpl.obj)
  "_objc_msgSend$addChildWindow:", referenced from:
      -[GlassWindow _setVisible] in libglass.a(GlassWindow.obj)
  "_objc_msgSend$addGestureRecognizer:", referenced from:
      -[GlassViewDelegate initWithView:withJview:] in libglass.a(GlassViewDelegate.obj)
  "_objc_msgSend$addObject:", referenced from:
      -[GlassWindow addChildWindow:] in libglass.a(GlassWindow.obj)
  "_objc_msgSend$addObserver:selector:name:object:", referenced from:
      -[GlassViewGL requestInput:type:width:height:mxx:mxy:mxz:mxt:myx:myy:myz:myt:mzx:mzy:mzz:mzt:] in libglass.a(GlassViewGL.obj)
      -[GlassMainWindow initWithFrame:] in libglass.a(GlassWindow.obj)
  "_objc_msgSend$addSubview:", referenced from:
      +[GlassDragDelegate showImage:] in libglass.a(GlassDragDelegate.obj)
      -[GlassViewGL requestInput:type:width:height:mxx:mxy:mxz:mxt:myx:myy:myz:myt:mzx:mzy:mzz:mzt:] in libglass.a(GlassViewGL.obj)
      __1createWindow in libglass.a(GlassWindow.obj)
      _Java_com_sun_glass_ui_ios_IosWindow__1setView in libglass.a(GlassWindow.obj)
      -[WebViewImpl initWebViewImpl] in libwebview.a(WebViewImpl.obj)
      -[WebViewImpl updateWebView] in libwebview.a(WebViewImpl.obj)
  "_objc_msgSend$addToBuffer:length:", referenced from:
      _Java_com_sun_javafx_iio_ios_IosImageLoader_loadImage in libjavafx_iio.a(com_sun_javafx_iio_ios_IosImageLoader.obj)
  "_objc_msgSend$addToRunLoop:forMode:", referenced from:
      -[GlassViewGL initWithFrame:withJview:withJproperties:] in libglass.a(GlassViewGL.obj)
  "_objc_msgSend$allKeys", referenced from:
      _Java_com_sun_glass_ui_ios_IosPasteboard__1getUTFs in libglass.a(GlassPasteboard.obj)
  "_objc_msgSend$allObjects", referenced from:
      __1createWindow in libglass.a(GlassWindow.obj)
  "_objc_msgSend$allTouches", referenced from:
      -[GlassViewDelegate touchesBeganCallback:withEvent:] in libglass.a(GlassViewDelegate.obj)
      -[GlassViewDelegate sendJavaTouchEvent:] in libglass.a(GlassViewDelegate.obj)
  "_objc_msgSend$alloc", referenced from:
      _createContext in libprism_es2.a(IOSWindowSystemInterface.obj)
      -[GlassRunnable run] in libglass.a(GlassApplication.obj)
      -[GlassApplication initWithEnv:application:contextClassLoader:launchable:] in libglass.a(GlassApplication.obj)
      -[GlassApplication callWillResignActive] in libglass.a(GlassApplication.obj)
      -[GlassApplication callDidResignActive] in libglass.a(GlassApplication.obj)
      -[GlassApplication callDidReceiveMemoryWarning] in libglass.a(GlassApplication.obj)
      -[GlassApplication callWillBecomeActive] in libglass.a(GlassApplication.obj)
      ...

etc... [trancated]

ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Result
======
result: 1

If I try with Gluon Attach 4.0.21, I'm getting the same + additional link errors with the AudioService.

I already reported this (the AudioService in Gluon Attach 4.0.21 has link errors already with GluonFX Maven plugin 1.023 + GraalVM gluon-22.1.0.1-Final).

Steps to Reproduce

Your Environment

macOS 11.7.10 + GluonFX Maven plugin 1.0.24 + GraalVM gluon-23+25.1-dev + Gluon Attach 4.0.20 or 4.0.21

@salmonb salmonb added the bug Something isn't working label Oct 18, 2024
@jperedadnr
Copy link
Contributor

Have you tried with HelloGluon?

If I run

% nm ~/.gluon/substrate/javafxStaticSdk/24-ea+7.1/ios-arm64/sdk/lib/libglass.a | grep objc_msgSend
                 U _objc_msgSend$ApplicationNotifyDidBecomeActiveMethod
                 U _objc_msgSend$ApplicationNotifyDidReceiveMemoryWarningMethod
                 U _objc_msgSend$ApplicationNotifyDidResignActiveMethod
                 U _objc_msgSend$ApplicationNotifyWillBecomeActiveMethod
                 U _objc_msgSend$ApplicationNotifyWillQuitMethod
                 U _objc_msgSend$ApplicationNotifyWillResignActiveMethod
                 U _objc_msgSend$ClassForName:withEnv:
...

the symbols are indeed unresolved, but:

% nm target/gluonfx/arm64-ios/HelloGluon.app/HelloGluon | grep _objc_msgSend                   
                 U _objc_msgSend
0000000101aa8300 s _objc_msgSend$ApplicationClass
0000000101aa8320 s _objc_msgSend$ApplicationNotifyDidBecomeActiveMethod
0000000101aa8340 s _objc_msgSend$ApplicationNotifyDidReceiveMemoryWarningMethod
0000000101aa8360 s _objc_msgSend$ApplicationNotifyDidResignActiveMethod
0000000101aa8380 s _objc_msgSend$ApplicationNotifyWillBecomeActiveMethod
...

shows them resolved by the iOS SDK, as those are fundamental parts of the Objective-C runtime https://developer.apple.com/documentation/objectivec/1456712-objc_msgsend.

I believe you might have an issue with your iOS SDK version or your Xcode version, as they might be too old. As per https://stackoverflow.com/a/74108260/3956070, are you using Xcode 13 or lower?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants