Mac m1 - mvn clean install is failing at "PL/Java backend native code" - m1 arm64 architecture - postgresql

I cannot install maven (with command) 'mvn clean install' on Mac m1 chip as it fails at step PL/Java backend native code. (full build trace below)
I tried with 11,12(failed with a similar error). However, the build is successful only with Postgres 14.
I require earlier versions of Postgres (either 11,12 or 13) for my requirement.
I'd really appreciate some help on this.
Thanks in advance.
P.S:
I've installed java 11, postgres 13, apache maven 3.8.6 , tomcat 9 on my system prior trying to build.
[INFO] --- pljava-pgxs:2-SNAPSHOT:scripted-goal (build-shared-object) # pljava-so ---
Warning: Nashorn engine is planned to be removed from a future JDK release
[INFO] Using compiling/linking rules for Mac OS X
ld: warning: directory not found for option '-L/opt/local/Current/lib'
ld: warning: directory not found for option '-L/opt/local/libexec/llvm-9.0/lib'
ld: warning: directory not found for option '-L/opt/local/libexec/llvm-9.0/lib'
ld: warning: directory not found for option '-L/opt/local/20210916/lib'
ld: warning: directory not found for option '-L/opt/local/lib'
ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/Type.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/Composite.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/ErrorData.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/Oid.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/Short.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ld: warning: ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/Void.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/Float.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64ld: warning: ld: warning: ld: warning: ld: warning: ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/Portal.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/BigDecimal.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/PgSavepoint.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/Invocation.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/TypeOid.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/Time.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64ld: warning:
ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/Date.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/Relation.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/HashMap.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/TupleTable.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/Long.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/XactListener.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/SQLXMLImpl.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/PgObject.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/SQLInputFromChunk.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/Backend.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/SingleRowReader.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/Session.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/ExecutionPlan.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/TriggerData.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64ld: warning:
ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/Coerce.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64ld: warning:
ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/SQLOutputToChunk.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/Array.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/SubXactListener.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64ld: warning:
ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/AclId.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/TupleDesc.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/byte_array.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning:
ld: warning: ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/Double.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/Iterator.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/DualState.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/Integer.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/Tuple.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/Byte.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning:
ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/Timestamp.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/Function.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/SPI.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64ld: warning: ld: warning: ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/SQLOutputToTuple.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/VarlenaWrapper.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/Boolean.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/UDT.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/Exception.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/InstallHelper.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/Any.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/JNICalls.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/String.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /Users/kishorebiradavolu/pljava/pljava-so/target/pljava-pgxs/SQLInputFromTuple.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: can't link with a main executable file '/Library/PostgreSQL/13/bin/postgres' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for PostgreSQL PL/Java 2-SNAPSHOT:
[INFO]
[INFO] PostgreSQL PL/Java ................................. SUCCESS [ 0.514 s]
[INFO] PL/Java API ........................................ SUCCESS [ 1.997 s]
[INFO] PL/Java backend Java code .......................... SUCCESS [ 1.640 s]
[INFO] PL/Java PGXS ....................................... SUCCESS [ 1.615 s]
[INFO] PL/Java backend native code ........................ FAILURE [ 2.972 s]
[INFO] PL/Java Ant tasks .................................. SKIPPED
[INFO] PL/Java examples ................................... SKIPPED
[INFO] PL/Java packaging .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.794 s
[INFO] Finished at: 2022-09-22T17:45:29+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.postgresql:pljava-pgxs:2-SNAPSHOT:scripted-goal (build-shared-object) on project pljava-so: Linking failed with exit code: 1 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :pljava-so```

Related

Toast, building for iOS Simulator-x86_64 but attempting to link with file built for iOS Simulator-arm64

Today when I build the flutter 2.10.3 app, shows error like this:
Xcode's output:
↳
ld: warning: ignoring file /Users/spark/source/frontend/junk-open/build/ios/Debug-iphonesimulator/Toast/Toast.framework/Toast, building for iOS Simulator-x86_64 but attempting to link with file built for iOS Simulator-arm64
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_CSToastStyle", referenced from:
objc-class-ref in FluttertoastPlugin.o
"_CSToastPositionTop", referenced from:
-[FluttertoastPlugin handleMethodCall:result:] in FluttertoastPlugin.o
"_CSToastPositionCenter", referenced from:
-[FluttertoastPlugin handleMethodCall:result:] in FluttertoastPlugin.o
"_CSToastPositionBottom", referenced from:
-[FluttertoastPlugin handleMethodCall:result:] in FluttertoastPlugin.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
I have already exclude the x86_64 architecture, why still shows this error?

Why is my app returning hundreds of errors that say "undefinedSymbol"?

I am trying to archive my Xcode Project to send it to App Store Connect. The project is running completely fine on a normal build and run in the simulator or on a device. However when I archive my project, it returns 100-112 errors that begin with "undefinedSymbol." This happens even after I clean the build folder and restart Xcode.
I looked around Stack Overflow to see if I could find any solutions. I found this question and tried all of the following solution provided in the answers:
Set "Build Active Architecture Only" to "Yes"
Set "Build Active Architecture Only" to "No"
Deleted a pod (and reinstalled it again) "PhoneNumberKit" that seemed to be causing most of the errors.
Removed "arm64" and "armv7"
Deleted derived data the Xcode 'DerivedData' folder.
Added $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) to "Library Search Paths".
None of these solutions worked and I'm still getting the errors. However, when I did delete "PhoneNumberKit," the errors went down to only 70.
Here are some of the outputs Xcode gave me:
Warnings
d: warning: Could not find or use auto-linked library ‘swiftDarwin’
ld: warning: Could not find or use auto-linked library ‘swiftUIKit’
ld: warning: Could not find or use auto-linked library ‘swiftFoundation’
ld: warning: Could not find or use auto-linked library ‘swiftMetal’
ld: warning: Could not find or use auto-linked library ‘swiftObjectiveC’
ld: warning: Could not find or use auto-linked library ‘swiftCoreFoundation’
ld: warning: Could not find or use auto-linked library ‘swiftDispatch’
ld: warning: Could not find or use auto-linked library ‘swiftCoreImage’
ld: warning: Could not find or use auto-linked library ‘swiftQuartzCore’
ld: warning: Could not find or use auto-linked library ‘swiftCoreGraphics’
ld: warning: Could not find or use auto-linked library ‘swiftCore’
Errors
d /Users/michaelderiso/Library/Developer/Xcode/DerivedData/Hostend-gjaxiqkofklirhbihjmyftldzdvr/Build/Intermediates.noindex/ArchiveIntermediates/Hostend/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/PhoneNumberKit.build/Objects-normal/armv7/Binary/PhoneNumberKit normal armv7 (in target ‘PhoneNumberKit’ from project ‘Pods’)
There are even more after these!
I expected the Xcode project to archive normally. I also expected the error to be resolved after I tried some of the solutions from that Stack Overflow question. How can I fix this issue?
UPDATE:
This doesn't seem to be an issue in Xcode 10. Must be something with the beta. Any more potential solutions are welcome!

Error building archive in xcode for flutter.io app

I follow release instructions but I am getting a link error building the archive about the Reachability library not being found:
ld: warning: directory not found for option '-L/Users/bartwaggoner/Library/Developer/Xcode/DerivedData/Runner-duuffrseacvinacmifrehqvwbbxo/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/Reachability'
ld: warning: directory not found for option '-L/Users/bartwaggoner/Library/Developer/Xcode/DerivedData/Runner-duuffrseacvinacmifrehqvwbbxo/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/connectivity'
ld: warning: directory not found for option '-L/Users/bartwaggoner/Library/Developer/Xcode/DerivedData/Runner-duuffrseacvinacmifrehqvwbbxo/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/path_provider'
ld: warning: directory not found for option '-L/Users/bartwaggoner/Library/Developer/Xcode/DerivedData/Runner-duuffrseacvinacmifrehqvwbbxo/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/url_launcher'
ld: library not found for -lReachability
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've played around for half a day and so far no luck resolving this - could anyone help a mac.flutter newbie out?
Opening the .xcodeproj extension file instead of the .xcworkspace worked for me.

QuickFIX: How to change target platform

After compilation libquickfix.dylib, and link it in Xcode with my programm, error is:
ld: warning: ignoring file /Users/marekbaranowski/jmbSoftware/_NOM2/
QuickFIX/libquickfix.dylib, file was built for x86_64
which is not the architecture being linked (i386):
/Users/marekbaranowski/jmbSoftware/_NOM2/QuickFIX/libquickfix.dylib
How to change platform to i386, armv7 or both in one dylib?

Xcode4 App work fine on iPhoneSimulator,but build on Device got a armv6/7 error:(

I'm at a lost at this point. :(
The application is work fine iPhoneSimulator.
But when I try to build on Device(iphone4.3.1)(XCode4),
I get the following error:
When I choose Standard(armv6 armv7) to build:
ld: warning: ignoring file /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib/libxml2.dylib, file was built for unsupported file format which is not the architecture being linked (armv6)
ld: warning: ignoring file /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib/libxml2.2.dylib, file was built for unsupported file format which is not the architecture being linked (armv6)
ld: warning: ignoring file /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib/libz.1.2.3.dylib, file was built for unsupported file format which is not the architecture being linked (armv6)
ld: warning: ignoring file /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/Developer/Library/PrivateFrameworks/DTMessageQueueing.framework/DTMessageQueueing, file was built for unsupported file format which is not the architecture being linked (armv6)
ld: warning: ignoring file /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/Developer/Library/PrivateFrameworks/UIAutomation.framework/UIAutomation, file was built for unsupported file format which is not the architecture being linked (armv6)
ld: warning: ignoring file /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib/libSystem.dylib, file was built for unsupported file format which is not the architecture being linked (armv6)
ld: in /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib/libobjc.A.dylib, file was built for unsupported file format which is not the architecture being linked (armv6) for architecture armv6
When I choose Optimized(armv7) to build:
ld: warning: ignoring file /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib/libxml2.dylib, file was built for unsupported file format which is not the architecture being linked (armv7)
ld: warning: ignoring file /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib/libz.1.2.3.dylib, file was built for unsupported file format which is not the architecture being linked (armv7)
ld: warning: ignoring file /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/Developer/Library/PrivateFrameworks/DTMessageQueueing.framework/DTMessageQueueing, file was built for unsupported file format which is not the architecture being linked (armv7)
ld: warning: ignoring file /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/Developer/Library/PrivateFrameworks/UIAutomation.framework/UIAutomation, file was built for unsupported file format which is not the architecture being linked (armv7)
ld: warning: ignoring file /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib/libxml2.2.dylib, file was built for unsupported file format which is not the architecture being linked (armv7)
ld: warning: ignoring file /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib/libSystem.dylib, file was built for unsupported file format which is not the architecture being linked (armv7)
ld: in /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib/libobjc.A.dylib, file was built for unsupported file format which is not the architecture being linked (armv7) for architecture armv7
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1
Can anyone please provide any pointers on how to resolve this issues.
How can I resolve the unsupported file format which is not the architecture being linked (armv6) for architecture armv6 errors.
Any help would be greatly appreciated.
Thank you!!!
Remove the libraries mentioned and re-add them using the '+' button in 'Link Binary with Libraries' section of your target's Build Phases tab.
I was able to resolve a similar problem but check/adding entries to Search Path segment of the Build Settings for the app.
The Framework Search Paths item contains old references to 4.3 SDK paths that were probably correct before I upgrade to SDK 5.0.
Whether necessary or not, I added entries under Debug for IOS Simulator 5.0 and Any IOS SDK that distinguished between the path through iPhoneSimulator.Platform and iPhoneOS.Platform directories.