gnustep / libs-base

The GNUstep Base Library is a library of general-purpose, non-graphical Objective C objects.
https://www.gnustep.org/
GNU General Public License v2.0
932 stars 281 forks source link

Error: symbol `__objc_class_ref__GSMutableInsensitiveDictionary.lto_priv.1' is already defined #172

Closed sagitter closed 3 years ago

sagitter commented 3 years ago

Hi all.

gnustep-base-1.27.0 is not compiled in Fedora 34 because of this error:

gcc  -shared -Wl,-soname,libgnustep-base.so.1.27 -rdynamic     -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -shared-libgcc  -pthread -fexceptions -o ./obj/libgnustep-base.so.1.27.0 obj/libgnustep-base.obj/GSLocale.m.o obj/libgnustep-base.obj/preface.m.o obj/libgnustep-base.obj/cifframe.m.o obj/libgnustep-base.obj/CXXException.m.o obj/libgnustep-base.obj/GSArray.m.o obj/libgnustep-base.obj/GSAttributedString.m.o obj/libgnustep-base.obj/GSBlocks.m.o obj/libgnustep-base.obj/GSConcreteValue.m.o obj/libgnustep-base.obj/GSCountedSet.m.o obj/libgnustep-base.obj/GSDictionary.m.o obj/libgnustep-base.obj/GSFTPURLHandle.m.o obj/libgnustep-base.obj/GSFormat.m.o obj/libgnustep-base.obj/GSHTTPAuthentication.m.o obj/libgnustep-base.obj/GSHTTPURLHandle.m.o obj/libgnustep-base.obj/GSICUString.m.o obj/libgnustep-base.obj/GSOrderedSet.m.o obj/libgnustep-base.obj/GSPrivateHash.m.o obj/libgnustep-base.obj/GSQuickSort.m.o obj/libgnustep-base.obj/GSRunLoopWatcher.m.o obj/libgnustep-base.obj/GSSet.m.o obj/libgnustep-base.obj/GSShellSort.m.o obj/libgnustep-base.obj/GSSocketStream.m.o obj/libgnustep-base.obj/GSStream.m.o obj/libgnustep-base.obj/GSString.m.o obj/libgnustep-base.obj/GSTimSort.m.o obj/libgnustep-base.obj/GSTLS.m.o obj/libgnustep-base.obj/GSValue.m.o obj/libgnustep-base.obj/GSSocksParser/GSSocksParser.m.o obj/libgnustep-base.obj/GSSocksParser/GSSocksParserPrivate.m.o obj/libgnustep-base.obj/GSSocksParser/GSSocks4Parser.m.o obj/libgnustep-base.obj/GSSocksParser/GSSocks5Parser.m.o obj/libgnustep-base.obj/NSAffineTransform.m.o obj/libgnustep-base.obj/NSAppleEventDescriptor.m.o obj/libgnustep-base.obj/NSAppleEventManager.m.o obj/libgnustep-base.obj/NSAppleScript.m.o obj/libgnustep-base.obj/NSArchiver.m.o obj/libgnustep-base.obj/NSArray.m.o obj/libgnustep-base.obj/NSAssertionHandler.m.o obj/libgnustep-base.obj/NSAttributedString.m.o obj/libgnustep-base.obj/NSAutoreleasePool.m.o obj/libgnustep-base.obj/NSBackgroundActivityScheduler.m.o obj/libgnustep-base.obj/NSBundle.m.o obj/libgnustep-base.obj/NSByteCountFormatter.m.o obj/libgnustep-base.obj/NSCache.m.o obj/libgnustep-base.obj/NSCachedURLResponse.m.o obj/libgnustep-base.obj/NSCalendar.m.o obj/libgnustep-base.obj/NSCalendarDate.m.o obj/libgnustep-base.obj/NSCallBacks.m.o obj/libgnustep-base.obj/NSCharacterSet.m.o obj/libgnustep-base.obj/NSClassDescription.m.o obj/libgnustep-base.obj/NSCoder.m.o obj/libgnustep-base.obj/NSCopyObject.m.o obj/libgnustep-base.obj/NSCountedSet.m.o obj/libgnustep-base.obj/NSConcreteHashTable.m.o obj/libgnustep-base.obj/NSConcreteMapTable.m.o obj/libgnustep-base.obj/NSConnection.m.o obj/libgnustep-base.obj/NSData.m.o obj/libgnustep-base.obj/NSDate.m.o obj/libgnustep-base.obj/NSDateComponentsFormatter.m.o obj/libgnustep-base.obj/NSDateFormatter.m.o obj/libgnustep-base.obj/NSDateInterval.m.o obj/libgnustep-base.obj/NSDateIntervalFormatter.m.o obj/libgnustep-base.obj/NSDebug.m.o obj/libgnustep-base.obj/NSDecimal.m.o obj/libgnustep-base.obj/NSDecimalNumber.m.o obj/libgnustep-base.obj/NSDictionary.m.o obj/libgnustep-base.obj/NSDistantObject.m.o obj/libgnustep-base.obj/NSDistributedLock.m.o obj/libgnustep-base.obj/NSDistributedNotificationCenter.m.o obj/libgnustep-base.obj/NSEnergyFormatter.m.o obj/libgnustep-base.obj/NSEnumerator.m.o obj/libgnustep-base.obj/NSError.m.o obj/libgnustep-base.obj/NSException.m.o obj/libgnustep-base.obj/NSExtensionContext.m.o obj/libgnustep-base.obj/NSExtensionItem.m.o obj/libgnustep-base.obj/NSFileCoordinator.m.o obj/libgnustep-base.obj/NSFileHandle.m.o obj/libgnustep-base.obj/NSFileManager.m.o obj/libgnustep-base.obj/NSFileVersion.m.o obj/libgnustep-base.obj/NSFileWrapper.m.o obj/libgnustep-base.obj/NSFormatter.m.o obj/libgnustep-base.obj/NSGarbageCollector.m.o obj/libgnustep-base.obj/NSGeometry.m.o obj/libgnustep-base.obj/NSHashTable.m.o obj/libgnustep-base.obj/NSHFSFileTypes.m.o obj/libgnustep-base.obj/NSHost.m.o obj/libgnustep-base.obj/NSHTTPCookie.m.o obj/libgnustep-base.obj/NSHTTPCookieStorage.m.o obj/libgnustep-base.obj/NSIndexPath.m.o obj/libgnustep-base.obj/NSIndexSet.m.o obj/libgnustep-base.obj/NSInvocation.m.o obj/libgnustep-base.obj/NSInvocationOperation.m.o obj/libgnustep-base.obj/NSISO8601DateFormatter.m.o obj/libgnustep-base.obj/NSItemProvider.m.o obj/libgnustep-base.obj/NSItemProviderReadingWriting.m.o obj/libgnustep-base.obj/NSJSONSerialization.m.o obj/libgnustep-base.obj/NSKeyedArchiver.m.o obj/libgnustep-base.obj/NSKeyedUnarchiver.m.o obj/libgnustep-base.obj/NSKeyValueCoding.m.o obj/libgnustep-base.obj/NSKeyValueObserving.m.o obj/libgnustep-base.obj/NSLengthFormatter.m.o obj/libgnustep-base.obj/NSLinguisticTagger.m.o obj/libgnustep-base.obj/NSLocale.m.o obj/libgnustep-base.obj/NSLock.m.o obj/libgnustep-base.obj/NSLog.m.o obj/libgnustep-base.obj/NSMapTable.m.o obj/libgnustep-base.obj/NSMassFormatter.m.o obj/libgnustep-base.obj/NSMeasurementFormatter.m.o obj/libgnustep-base.obj/NSMeasurement.m.o obj/libgnustep-base.obj/NSMetadata.m.o obj/libgnustep-base.obj/NSMetadataAttributes.m.o obj/libgnustep-base.obj/NSMethodSignature.m.o obj/libgnustep-base.obj/NSNotification.m.o obj/libgnustep-base.obj/NSNotificationCenter.m.o obj/libgnustep-base.obj/NSNotificationQueue.m.o obj/libgnustep-base.obj/NSNull.m.o obj/libgnustep-base.obj/NSNumber.m.o obj/libgnustep-base.obj/NSNumberFormatter.m.o obj/libgnustep-base.obj/NSObjCRuntime.m.o obj/libgnustep-base.obj/NSObject.m.o obj/libgnustep-base.obj/NSObjectScripting.m.o obj/libgnustep-base.obj/NSObject+NSComparisonMethods.m.o obj/libgnustep-base.obj/NSOperation.m.o obj/libgnustep-base.obj/NSOrderedSet.m.o obj/libgnustep-base.obj/NSOrthography.m.o obj/libgnustep-base.obj/NSPage.m.o obj/libgnustep-base.obj/NSPathUtilities.m.o obj/libgnustep-base.obj/NSPersonNameComponents.m.o obj/libgnustep-base.obj/NSPersonNameComponentsFormatter.m.o obj/libgnustep-base.obj/NSPipe.m.o obj/libgnustep-base.obj/NSPointerArray.m.o obj/libgnustep-base.obj/NSPointerFunctions.m.o obj/libgnustep-base.obj/NSConcretePointerFunctions.m.o obj/libgnustep-base.obj/NSPort.m.o obj/libgnustep-base.obj/NSPortCoder.m.o obj/libgnustep-base.obj/NSPortMessage.m.o obj/libgnustep-base.obj/NSPortNameServer.m.o obj/libgnustep-base.obj/NSPredicate.m.o obj/libgnustep-base.obj/NSProcessInfo.m.o obj/libgnustep-base.obj/NSProgress.m.o obj/libgnustep-base.obj/NSPropertyList.m.o obj/libgnustep-base.obj/NSProtocolChecker.m.o obj/libgnustep-base.obj/NSProxy.m.o obj/libgnustep-base.obj/NSRange.m.o obj/libgnustep-base.obj/NSRegularExpression.m.o obj/libgnustep-base.obj/NSRunLoop.m.o obj/libgnustep-base.obj/NSScanner.m.o obj/libgnustep-base.obj/NSScriptClassDescription.m.o obj/libgnustep-base.obj/NSScriptCoercionHandler.m.o obj/libgnustep-base.obj/NSScriptCommand.m.o obj/libgnustep-base.obj/NSScriptCommandDescription.m.o obj/libgnustep-base.obj/NSScriptExecutionContext.m.o obj/libgnustep-base.obj/NSScriptKeyValueCoding.m.o obj/libgnustep-base.obj/NSScriptObjectSpecifiers.m.o obj/libgnustep-base.obj/NSScriptStandardSuiteCommands.m.o obj/libgnustep-base.obj/NSScriptSuiteRegistry.m.o obj/libgnustep-base.obj/NSUnit.m.o obj/libgnustep-base.obj/NSUserActivity.m.o obj/libgnustep-base.obj/NSUserScriptTask.m.o obj/libgnustep-base.obj/NSSerializer.m.o obj/libgnustep-base.obj/NSSet.m.o obj/libgnustep-base.obj/NSSocketPort.m.o obj/libgnustep-base.obj/NSSocketPortNameServer.m.o obj/libgnustep-base.obj/NSSortDescriptor.m.o obj/libgnustep-base.obj/NSSpellServer.m.o obj/libgnustep-base.obj/NSString.m.o obj/libgnustep-base.obj/NSTask.m.o obj/libgnustep-base.obj/NSThread.m.o obj/libgnustep-base.obj/NSTimer.m.o obj/libgnustep-base.obj/NSTimeZone.m.o obj/libgnustep-base.obj/NSUbiquitousKeyValueStore.m.o obj/libgnustep-base.obj/NSUnarchiver.m.o obj/libgnustep-base.obj/NSUndoManager.m.o obj/libgnustep-base.obj/NSURL.m.o obj/libgnustep-base.obj/NSURLSession.m.o obj/libgnustep-base.obj/NSURLAuthenticationChallenge.m.o obj/libgnustep-base.obj/NSURLCache.m.o obj/libgnustep-base.obj/NSURLCredential.m.o obj/libgnustep-base.obj/NSURLConnection.m.o obj/libgnustep-base.obj/NSURLCredentialStorage.m.o obj/libgnustep-base.obj/NSURLDownload.m.o obj/libgnustep-base.obj/NSURLProtectionSpace.m.o obj/libgnustep-base.obj/NSURLProtocol.m.o obj/libgnustep-base.obj/NSURLRequest.m.o obj/libgnustep-base.obj/NSURLResponse.m.o obj/libgnustep-base.obj/NSTextCheckingResult.m.o obj/libgnustep-base.obj/NSURLHandle.m.o obj/libgnustep-base.obj/NSUserDefaults.m.o obj/libgnustep-base.obj/NSUserNotification.m.o obj/libgnustep-base.obj/NSUUID.m.o obj/libgnustep-base.obj/NSValue.m.o obj/libgnustep-base.obj/NSValueTransformer.m.o obj/libgnustep-base.obj/NSXMLDocument.m.o obj/libgnustep-base.obj/NSXMLDTD.m.o obj/libgnustep-base.obj/NSXMLDTDNode.m.o obj/libgnustep-base.obj/NSXMLElement.m.o obj/libgnustep-base.obj/NSXMLNode.m.o obj/libgnustep-base.obj/NSXMLParser.m.o obj/libgnustep-base.obj/NSXPCConnection.m.o obj/libgnustep-base.obj/NSZone.m.o obj/libgnustep-base.obj/externs.m.o obj/libgnustep-base.obj/objc-load.m.o obj/libgnustep-base.obj/GSFileHandle.m.o obj/libgnustep-base.obj/NSMessagePort.m.o obj/libgnustep-base.obj/NSMessagePortNameServer.m.o obj/libgnustep-base.obj/NSNetServices.m.o obj/libgnustep-base.obj/GSAvahiNetService.m.o obj/libgnustep-base.obj/GSAvahiNetServiceBrowser.m.o obj/libgnustep-base.obj/GSAvahiClient.m.o obj/libgnustep-base.obj/GSAvahiRunLoopIntegration.m.o obj/libgnustep-base.obj/GSFFIInvocation.m.o ObjectiveC2/obj/subproject.o Additions/obj/subproject.o unix/obj/subproject.o   -L./obj    -L/builddir/GNUstep/Library/Libraries -L/usr/local/lib64 -L/usr/lib64  -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld  -Wl,--as-needed -L/usr/local/lib64 -L/usr/local/lib64 -L/usr/lib64  -lobjc -lgmp -lavahi-common -lavahi-client -lgnutls  -lxslt -lxml2  -lffi  -lrt -ldl  -lpthread -lz -licui18n -licuuc -licudata  -lm  && (cd ./obj; rm -f libgnustep-base.so; if [ "libgnustep-base.so.1.27" != "libgnustep-base.so.1.27.0" ]; then rm -f libgnustep-base.so.1.27; ln -s libgnustep-base.so.1.27.0 libgnustep-base.so.1.27; fi; ln -s libgnustep-base.so.1.27 libgnustep-base.so; )
In function 'strncpy',
    inlined from 'ValueForKey' at NSKeyValueCoding.m:167:7,
    inlined from '_i_NSObject_KeyValueCoding_valueForKey_' at NSKeyValueCoding.m:529:10:
/usr/include/bits/string_fortified.h:95:10: warning: '__builtin_strncpy' specified bound depends on the length of the source argument [-Wstringop-overflow=]
   95 |   return __builtin___strncpy_chk (__dest, __src, __len,
      |          ^
NSKeyValueCoding.m: In function '_i_NSObject_KeyValueCoding_valueForKey_':
NSKeyValueCoding.m:528:10: note: length computed here
  528 |   size = strlen(key);
      |          ^
In function 'strncpy',
    inlined from '_i_NSObject_KeyValueCoding_storedValueForKey_' at NSKeyValueCoding.m:619:7:
/usr/include/bits/string_fortified.h:95:10: warning: '__builtin_strncpy' specified bound depends on the length of the source argument [-Wstringop-overflow=]
   95 |   return __builtin___strncpy_chk (__dest, __src, __len,
      |          ^
NSKeyValueCoding.m: In function '_i_NSObject_KeyValueCoding_storedValueForKey_':
NSKeyValueCoding.m:618:14: note: length computed here
  618 |       size = strlen(key);
      |              ^
In function 'strncpy',
    inlined from '_i_NSObject_KeyValueCoding_takeStoredValue_forKey_' at NSKeyValueCoding.m:704:7:
/usr/include/bits/string_fortified.h:95:10: warning: '__builtin_strncpy' specified bound depends on the length of the source argument [-Wstringop-overflow=]
   95 |   return __builtin___strncpy_chk (__dest, __src, __len,
      |          ^
NSKeyValueCoding.m: In function '_i_NSObject_KeyValueCoding_takeStoredValue_forKey_':
NSKeyValueCoding.m:703:14: note: length computed here
  703 |       size = strlen(key);
      |              ^
In function 'strncpy',
    inlined from '_i_NSObject_KeyValueCoding_takeValue_forKey_' at NSKeyValueCoding.m:823:7:
/usr/include/bits/string_fortified.h:95:10: warning: '__builtin_strncpy' specified bound depends on the length of the source argument [-Wstringop-overflow=]
   95 |   return __builtin___strncpy_chk (__dest, __src, __len,
      |          ^
NSKeyValueCoding.m: In function '_i_NSObject_KeyValueCoding_takeValue_forKey_':
NSKeyValueCoding.m:814:10: note: length computed here
  814 |   size = strlen(key);
      |          ^
In function 'strncpy',
    inlined from 'GSSetupEncodingTable.part.0' at Additions/Unicode.m:341:5:
/usr/include/bits/string_fortified.h:95:10: warning: '__builtin_strncpy' specified bound depends on the length of the source argument [-Wstringop-overflow=]
   95 |   return __builtin___strncpy_chk (__dest, __src, __len,
      |          ^
Additions/Unicode.m: In function 'GSSetupEncodingTable.part.0':
Additions/Unicode.m:339:23: note: length computed here
  339 |                   l = strlen(entry->iconv);
      |                       ^
In function 'strncpy',
    inlined from 'SetValueForKey' at NSKeyValueCoding.m:95:7,
    inlined from '_i_NSObject_KeyValueCoding_setValue_forKey_' at NSKeyValueCoding.m:370:3:
/usr/include/bits/string_fortified.h:95:10: warning: '__builtin_strncpy' specified bound depends on the length of the source argument [-Wstringop-overflow=]
   95 |   return __builtin___strncpy_chk (__dest, __src, __len,
      |          ^
NSKeyValueCoding.m: In function '_i_NSObject_KeyValueCoding_setValue_forKey_':
NSKeyValueCoding.m:369:10: note: length computed here
  369 |   size = strlen(key);
      |          ^
In function 'strncpy',
    inlined from 'newDataWithEncodedPort' at NSMessagePort.m:199:3:
/usr/include/bits/string_fortified.h:95:10: warning: '__builtin_strncpy' specified bound depends on the length of the source argument [-Wstringop-overflow=]
   95 |   return __builtin___strncpy_chk (__dest, __src, __len,
      |          ^
NSMessagePort.m: In function 'newDataWithEncodedPort':
NSMessagePort.m:199:41: note: length computed here
  199 |   strncpy((char*)pi->addr, (char*)name, strlen((char*)name) + 1);
      |                                         ^
/tmp/ccK5XvmG.s: Assembler messages:
/tmp/ccK5XvmG.s:34584: Error: symbol `__objc_class_ref__GSMutableInsensitiveDictionary.lto_priv.1' is already defined
make[5]: *** [/tmp/ccnanzui.mk:194: /tmp/ccIPvrZq.ltrans64.ltrans.o] Error 1
rfm commented 3 years ago

On 9 Feb 2021, at 10:25, Antonio notifications@github.com wrote:

Hi all.

gnustep-base-1.27.0 is not compiled in Fedora 34 because of this error:

...

/tmp/ccK5XvmG.s:34584: Error: symbol `objc_class_refGSMutableInsensitiveDictionary.lto_priv.1' is already defined make[5]: *** [/tmp/ccnanzui.mk:194: /tmp/ccIPvrZq.ltrans64.ltrans.o] Error 1

I don't get that on Fedora 33 with trunk (which really needs to be the basis of a new release very soon), either building with gcc or with clang/libobjc2 Please could you see if you get the same issue using trunk. If you do get that issue using trunk, please could you provide your config.log, so we can see exactly what the setup is.

sagitter commented 3 years ago

If you do get that issue using trunk, please could you provide your config.log, so we can see exactly what the setup is.

config.log is attached config-log.zip

rfm commented 3 years ago

I could see that the same compiler is used as on my fedora-33 system, so I guess the issue is with the linker.

rfm commented 3 years ago

And in the configure script I can see that it warns of bad link options being used:

configure:2772: WARNING: You are running configure with the link options (-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ) set to a different value from that used by gnustep-make (-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -shared-libgcc). To avoid conflicts/problems, reconfigure/reinstall gnustep-make to use LDFLAGS=-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld or run the gnustep-base configure again with your LDFLAGS environment variable set to -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -shared-libgcc

So this looks like the issue is probably with explicitly configuring the packages with inconsistent options, rather than a bug as such.

rfm commented 3 years ago

Closing ... no feedback in 6 months