+ // if file has linker options, process them
+ ld::relocatable::File::LinkerOptionsList* lo = objFile->linkerOptions();
+ if ( lo != NULL && !_options.ignoreAutoLink() ) {
+ for (relocatable::File::LinkerOptionsList::const_iterator it=lo->begin(); it != lo->end(); ++it) {
+ this->doLinkerOption(*it, file.path());
+ }
+ // <rdar://problem/23053404> process any additional linker-options introduced by this new archive member being loaded
+ if ( _completedInitialObjectFiles ) {
+ _inputFiles.addLinkerOptionLibraries(_internal, *this);
+ _inputFiles.createIndirectDylibs();
+ }
+ }
+ // Resolve bitcode section in the object file
+ if ( _options.bundleBitcode() ) {
+ if ( objFile->getBitcode() == NULL ) {
+ // No bitcode section, figure out if the object file comes from LTO/compiler static library
+ if (objFile->sourceKind() != ld::relocatable::File::kSourceLTO &&
+ objFile->sourceKind() != ld::relocatable::File::kSourceCompilerArchive ) {
+ switch ( _options.platform() ) {
+ case Options::kPlatformOSX:
+ case Options::kPlatformUnknown:
+ warning("all bitcode will be dropped because '%s' was built without bitcode. "
+ "You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. ", file.path());
+ _internal.filesWithBitcode.clear();
+ _internal.dropAllBitcode = true;
+ break;
+ case Options::kPlatformiOS:
+ throwf("'%s' does not contain bitcode. "
+ "You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target.", file.path());
+ break;
+ case Options::kPlatformWatchOS:
+#if SUPPORT_APPLE_TV
+ case Options::kPlatform_tvOS:
+#endif
+ throwf("'%s' does not contain bitcode. "
+ "You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE) or obtain an updated library from the vendor", file.path());
+ break;
+ }
+ }
+ } else {
+ // contains bitcode, check if it is just a marker
+ if ( objFile->getBitcode()->isMarker() ) {
+ // if -bitcode_verify_bundle is used, check if all the object files participate in the linking have full bitcode embedded.
+ // error on any marker encountered.
+ if ( _options.verifyBitcode() )
+ throwf("bitcode bundle could not be generated because '%s' was built without full bitcode. "
+ "All object files and libraries for bitcode must be generated from Xcode Archive or Install build",
+ objFile->path());
+ // update the internal state that marker is encountered.
+ _internal.embedMarkerOnly = true;
+ _internal.filesWithBitcode.clear();
+ _internal.dropAllBitcode = true;
+ } else if ( !_internal.dropAllBitcode )
+ _internal.filesWithBitcode.push_back(objFile);
+ }
+ }
+