@@ -97,13 +97,14 @@ impl<'a> ArchiveBuilder<'a> for LlvmArchiveBuilder<'a> {
9797
9898 /// Combine the provided files, rlibs, and native libraries into a single
9999 /// `Archive`.
100- fn build ( mut self ) {
100+ fn build ( mut self ) -> bool {
101101 let kind = self . llvm_archive_kind ( ) . unwrap_or_else ( |kind| {
102102 self . sess . fatal ( & format ! ( "Don't know how to build archive of type: {}" , kind) )
103103 } ) ;
104104
105- if let Err ( e) = self . build_with_llvm ( kind) {
106- self . sess . fatal ( & format ! ( "failed to build archive: {}" , e) ) ;
105+ match self . build_with_llvm ( kind) {
106+ Ok ( any_members) => any_members,
107+ Err ( e) => self . sess . fatal ( & format ! ( "failed to build archive: {}" , e) ) ,
107108 }
108109 }
109110
@@ -270,7 +271,7 @@ impl<'a> LlvmArchiveBuilder<'a> {
270271 kind. parse ( ) . map_err ( |_| kind)
271272 }
272273
273- fn build_with_llvm ( & mut self , kind : ArchiveKind ) -> io:: Result < ( ) > {
274+ fn build_with_llvm ( & mut self , kind : ArchiveKind ) -> io:: Result < bool > {
274275 let mut additions = mem:: take ( & mut self . additions ) ;
275276 let mut strings = Vec :: new ( ) ;
276277 let mut members = Vec :: new ( ) ;
@@ -353,7 +354,7 @@ impl<'a> LlvmArchiveBuilder<'a> {
353354 } ;
354355 Err ( io:: Error :: new ( io:: ErrorKind :: Other , msg) )
355356 } else {
356- Ok ( ( ) )
357+ Ok ( !members . is_empty ( ) )
357358 } ;
358359 for member in members {
359360 llvm:: LLVMRustArchiveMemberFree ( member) ;
0 commit comments