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

Build: symbols "already defined" #19

Open
roblatham00 opened this issue Sep 9, 2022 · 6 comments
Open

Build: symbols "already defined" #19

roblatham00 opened this issue Sep 9, 2022 · 6 comments
Assignees

Comments

@roblatham00
Copy link

I tried both with Recorder straight from git and the 2.3.2 release, but keep getting this error when building:

% make
Consolidate compiler generated dependencies of target recorder
[  4%] Building C object lib/CMakeFiles/recorder.dir/recorder-posix.c.o
/home/robl/work/Recorder/lib/recorder-posix.c:42: warning: "_GNU_SOURCE" redefined
   42 | #define _GNU_SOURCE
      |
<command-line>: note: this is the location of the previous definition
/tmp/ccIsYwVa.s: Assembler messages:
/tmp/ccIsYwVa.s:1425: Error: symbol `pread64' is already defined
/tmp/ccIsYwVa.s:4723: Error: symbol `open64' is already defined
/tmp/ccIsYwVa.s:7799: Error: symbol `fopen64' is already defined
/tmp/ccIsYwVa.s:10294: Error: symbol `pwrite64' is already defined
/tmp/ccIsYwVa.s:12852: Error: symbol `lseek64' is already defined
make[2]: *** [lib/CMakeFiles/recorder.dir/build.make:132: lib/CMakeFiles/recorder.dir/recorder-posix.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:896: lib/CMakeFiles/recorder.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

I am on Ubuntu 22.04.1,
using gcc-11.2.0
libc version: 2.35-0ubuntu3.1

@wangvsa
Copy link
Member

wangvsa commented Sep 9, 2022

I tried the same system (using docker) but could not reproduce the error.
Also tried gcc-10, gcc-9 and gcc-8, both worked fine on my side. It also worked fine on Theta and Cori.
Could you give a try with an older version gcc just to narrow down the possibilities?

@wangvsa wangvsa self-assigned this Sep 9, 2022
@roblatham00
Copy link
Author

I don't have an older gcc handy but i did try clang-14:

/home/robl/work/Recorder/lib/recorder-posix.c:267:25: error: definition with same mangled name 'open64' as another definition
int RECORDER_POSIX_DECL(open)(const char *path, int flags, ...) {
                        ^
/home/robl/work/Recorder/lib/recorder-posix.c:246:25: note: previous definition is here
int RECORDER_POSIX_DECL(open64)(const char *path, int flags, ...) {
                        ^
1 warning and 1 error generated.

@wangvsa
Copy link
Member

wangvsa commented Sep 9, 2022

Hmm... Strange... Just tried clang-14.0.0 and it worked fine on my side.
open/open64 are the only functions reporting the error for clang?
If so, could you try adding "extern inline" right before int RECORDER_POSIX_DECL(open)(const char *path, int flags, ...)
and int RECORDER_POSIX_DECL(open64)(const char *path, int flags, ...) in lib/recorder-posix.c?

@roblatham00
Copy link
Author

I should point out that i'm running Ubuntu inside a 'windows subsystem for linux 2" instance -- I wonder what kind of libc modifications that introduces?

The 'extern inline' got me past the symbols errors (needed them around lseek, pread, pwrite, fopen, and their 64 bit counterparts). Now looks like there's something with C++ but that's a separate issue.

@wangvsa
Copy link
Member

wangvsa commented Sep 10, 2022

Yeah, I guess libc was the issue. Anyway, I probably should add "extern inline" to those functions just in case.
Let me know if there's any error for C++. Thanks.

@roblatham00
Copy link
Author

whatever the C++ errors were, they are fixed in 'pilgrim'.

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

No branches or pull requests

2 participants