Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Curl/URL module does not work with LLVM backend #26018

Open
jabraham17 opened this issue Sep 27, 2024 · 1 comment
Open

[Bug]: Curl/URL module does not work with LLVM backend #26018

jabraham17 opened this issue Sep 27, 2024 · 1 comment

Comments

@jabraham17
Copy link
Member

The following code fails to compile with the LLVM backend.

import URL;
var r = URL.openUrlReader("http://www.example.com");
$CHPL_HOME/modules/packages/Curl.chpl:159: In module 'Curl':
$CHPL_HOME/modules/packages/Curl.chpl:399: error: Could not find C variable CURLPAUSE_CONT - perhaps it is a complex macro?

However, when using the C backend this compiles and works properly. The root cause of this is that the LLVM backend can't have extern variables to macros (as the error message suggests), and so a fix for this issue would be to just have that support. However, I could not find a relevant existing issue for that feature request, and so instead am treating this as a bug with URL/Curl.

Chplenv

CHPL_TARGET_PLATFORM: darwin
CHPL_TARGET_COMPILER: llvm
CHPL_TARGET_ARCH: arm64
CHPL_TARGET_CPU: native *
CHPL_LOCALE_MODEL: flat
CHPL_COMM: none
CHPL_TASKS: qthreads
CHPL_LAUNCHER: none
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_MEM: jemalloc
CHPL_ATOMICS: cstdlib
CHPL_GMP: system *
CHPL_HWLOC: bundled *
CHPL_RE2: bundled *
CHPL_LLVM: system
CHPL_AUX_FILESYS: none

Chplenv with C backend

CHPL_TARGET_PLATFORM: darwin
CHPL_TARGET_COMPILER: clang *
CHPL_TARGET_ARCH: arm64
CHPL_TARGET_CPU: native *
CHPL_LOCALE_MODEL: flat
CHPL_COMM: none
CHPL_TASKS: qthreads
CHPL_LAUNCHER: none
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_MEM: jemalloc
CHPL_ATOMICS: cstdlib
CHPL_GMP: system *
CHPL_HWLOC: bundled *
CHPL_RE2: bundled *
CHPL_LLVM: system
CHPL_AUX_FILESYS: none
@mppf
Copy link
Member

mppf commented Sep 30, 2024

The root cause of this is that the LLVM backend can't have extern variables to macros (as the error message suggests)

Actually it can if they are simple enough. Either way, the issue is the same here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants