Build failure on s390x


(Vivian Kong) #1

After apply this commit, the s390x build started to fail:
https://github.com/apple/swift/commit/dc88e51321e0a4f281406c265a91308a06aa517f

The commit added 2 new functions in
stdlib/public/SwiftShims/RuntimeStubs.h. They are used in
stdlib/public/stubs/CommandLine.cpp with SWIFT_CC(swift) macro. Since we
use the LLVM's intrinsic "swiftcall" on s390x, this caused a build error.
To fix it we added the SWIFT_CC(swift) macro and #include
"swift/Runtime/Config.h" to RuntimeStubs.h. We then ran into this build
error:

<module-includes>:9:10: note: in file included from <module-includes>:9:
#include "RuntimeStubs.h"
         ^
/localbox/vivkong/swift/build/Ninja-RelWithDebInfoAssert/swift-linux-s390x/./lib/swift/shims/RuntimeStubs.h:23:10:
error:
'swift/Runtime/Config.h' file not found
#include "swift/Runtime/Config.h"

I tried modifying stdlib/public/SwiftShims/CMakeLists.txt with

include_directories(
  ${CMAKE_SOURCE_DIR}/include
  )

But that didn't seem to work. Any suggestions on how to fix this?

Thanks for your help!

Regards,

Vivian Kong
Software Developer
IBM Canada Toronto Lab


(Jordan Rose) #2

Hi, Vivian. RuntimeStubs.h (along with the rest of SwiftShims) is a header that gets shipped with the Swift library, so it can’t refer to anything outside of its folder. Since we don’t yet have a good way to annotate things as using the Swift calling convention in the SwiftShims headers, we should probably not be using the Swift calling convention there (at least for now). Can you write up a pull request removing the SWIFT_CC annotation from the functions declared in RuntimeStubs.h?

(I’m a little concerned that Clang didn’t tell us that the calling convention isn’t consistent across declarations, but that’s a separate issue. Maybe the lack of an annotation isn’t strong enough information to produce a warning.)

Thanks,
Jordan

···

On Aug 9, 2016, at 07:42, Vivian Kong via swift-dev <swift-dev@swift.org> wrote:

After apply this commit, the s390x build started to fail:
https://github.com/apple/swift/commit/dc88e51321e0a4f281406c265a91308a06aa517f

The commit added 2 new functions in stdlib/public/SwiftShims/RuntimeStubs.h. They are used in stdlib/public/stubs/CommandLine.cpp with SWIFT_CC(swift) macro. Since we use the LLVM's intrinsic "swiftcall" on s390x, this caused a build error. To fix it we added the SWIFT_CC(swift) macro and #include "swift/Runtime/Config.h" to RuntimeStubs.h. We then ran into this build error:

<module-includes>:9:10: note: in file included from <module-includes>:9:
#include "RuntimeStubs.h"
^
/localbox/vivkong/swift/build/Ninja-RelWithDebInfoAssert/swift-linux-s390x/./lib/swift/shims/RuntimeStubs.h:23:10: error: 'swift/Runtime/Config.h' file not found
#include "swift/Runtime/Config.h"

I tried modifying stdlib/public/SwiftShims/CMakeLists.txt with

include_directories(
${CMAKE_SOURCE_DIR}/include
)

But that didn't seem to work. Any suggestions on how to fix this?

Thanks for your help!

Regards,

Vivian Kong
Software Developer
IBM Canada Toronto Lab
_______________________________________________
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev


(Vivian Kong) #3

Thanks Jordan! I'll create a pull request.

Regards,

Vivian Kong
Software Developer
IBM Canada Toronto Lab

···

From: Jordan Rose <jordan_rose@apple.com>
To: Vivian Kong/Toronto/IBM@IBMCA
Cc: swift-dev <swift-dev@swift.org>, Robert Widmann
            <rwidmann@apple.com>
Date: 2016/08/09 05:08 PM
Subject: Re: [swift-dev] Build failure on s390x
Sent by: jordan_rose@apple.com

Hi, Vivian. RuntimeStubs.h (along with the rest of SwiftShims) is a header
that gets shipped with the Swift library, so it can’t refer to anything
outside of its folder. Since we don’t yet have a good way to annotate
things as using the Swift calling convention in the SwiftShims headers, we
should probably not be using the Swift calling convention there (at least
for now). Can you write up a pull request removing the SWIFT_CC annotation
from the functions declared in RuntimeStubs.h?

(I’m a little concerned that Clang didn’t tell us that the calling
convention isn’t consistent across declarations, but that’s a separate
issue. Maybe the lack of an annotation isn’t strong enough information to
produce a warning.)

Thanks,
Jordan

      On Aug 9, 2016, at 07:42, Vivian Kong via swift-dev < swift-dev@swift.org> wrote:

      After apply this commit, the s390x build started to fail:
      https://github.com/apple/swift/commit/dc88e51321e0a4f281406c265a91308a06aa517f

      The commit added 2 new functions in
      stdlib/public/SwiftShims/RuntimeStubs.h. They are used in
      stdlib/public/stubs/CommandLine.cpp with SWIFT_CC(swift) macro. Since
      we use the LLVM's intrinsic "swiftcall" on s390x, this caused a build
      error. To fix it we added the SWIFT_CC(swift) macro and #include
      "swift/Runtime/Config.h" to RuntimeStubs.h. We then ran into this
      build error:

      <module-includes>:9:10: note: in file included from
      <module-includes>:9:
      #include "RuntimeStubs.h"
      ^
      /localbox/vivkong/swift/build/Ninja-RelWithDebInfoAssert/swift-linux-s390x/./lib/swift/shims/RuntimeStubs.h:23:10:
error:
      'swift/Runtime/Config.h' file not found
      #include "swift/Runtime/Config.h"

      I tried modifying stdlib/public/SwiftShims/CMakeLists.txt with

      include_directories(
      ${CMAKE_SOURCE_DIR}/include
      )

      But that didn't seem to work. Any suggestions on how to fix this?

      Thanks for your help!

      Regards,

      Vivian Kong
      Software Developer
      IBM Canada Toronto Lab

      _______________________________________________
      swift-dev mailing list
      swift-dev@swift.org
      https://lists.swift.org/mailman/listinfo/swift-dev