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

strange Str/linker bug. #7761

Closed
vicuna opened this issue Oct 21, 2002 · 3 comments
Closed

strange Str/linker bug. #7761

vicuna opened this issue Oct 21, 2002 · 3 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Oct 21, 2002

Original bug ID: 1450
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Hello, ...

This is a strange problem i got with the debian package.

==============================
aurora:~$ ocamlopt str.cmxa stuff.ml
/usr/lib/ocaml/libasmrun.a(str.o)(.text+0x1de): In function is_printable': : undefined reference to __ctype_b'
collect2: ld returned 1 exit status
Error during linking

stuff.ml is an empty file.

This does not occur when I build the distribution from source by hand,
Debian or upstream. I can actually copy the libasmrun.a file from the
compiled source tree into /usr/lib/ocaml and the build will succeed:

aurora:/usr/src/ocaml/ocaml-3.06/asmrun# cp libasmrun* /usr/lib/ocaml
aurora:$ ocamlopt str.cmxa stuff.ml
aurora:
$

This is, in addition to the first time I've seen the error, the first
time I've used Str. Learning the language :)

Well, it is solved by just rebuilding the package, so that is what i
will do. I guess it may be linked with the fact that we changed libc or
something like that between the time the ocaml package was built and the
time it was used.

Still it seems strange to me, and so i think it may be interresting for
you to know. Also if you have any hint as to the reason of this problem,
i am interrested.

Friendly,

Svne Luther

@vicuna
Copy link
Author

vicuna commented Oct 29, 2002

Comment author: administrator

This is a strange problem i got with the debian package.

==============================
aurora:~$ ocamlopt str.cmxa stuff.ml
/usr/lib/ocaml/libasmrun.a(str.o)(.text+0x1de): In function is_printable': : undefined reference to __ctype_b'
collect2: ld returned 1 exit status
Error during linking
[...]
Well, it is solved by just rebuilding the package, so that is what i
will do. I guess it may be linked with the fact that we changed libc or
something like that between the time the ocaml package was built and the
time it was used.

Looks like a libc change, indeed. On my Linux system, the libc header
<ctype.h> defines isprint(c) as a macro that expands to something
involving the global variable __ctype_b. Perhaps other versions of
libc expand isprint differently and do not define __ctype_b.

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Oct 29, 2002

Comment author: administrator

Looks like a libc change.

@vicuna vicuna closed this as completed Oct 29, 2002
@vicuna
Copy link
Author

vicuna commented Oct 29, 2002

Comment author: administrator

On Tue, Oct 29, 2002 at 02:58:01PM +0100, Xavier Leroy wrote:

This is a strange problem i got with the debian package.

==============================
aurora:~$ ocamlopt str.cmxa stuff.ml
/usr/lib/ocaml/libasmrun.a(str.o)(.text+0x1de): In function is_printable': : undefined reference to __ctype_b'
collect2: ld returned 1 exit status
Error during linking
[...]
Well, it is solved by just rebuilding the package, so that is what i
will do. I guess it may be linked with the fact that we changed libc or
something like that between the time the ocaml package was built and the
time it was used.

Looks like a libc change, indeed. On my Linux system, the libc header
<ctype.h> defines isprint(c) as a macro that expands to something
involving the global variable __ctype_b. Perhaps other versions of
libc expand isprint differently and do not define __ctype_b.

Well, after a bit more looking, it happened when glibc 2.3.1 was
installed, while we built ocaml with glibc 2.2.5.

So, i rebuilt ocaml, and the dependency is now libc6 (>= 2.3.1-1), so
this is fixed.

BTW, i noticed this already some time ago, but it didn't find a way to
send a follow-up on a bug report trough the ocaml/bug web pages.

BTW2, do you have any idea about the not-dying thread issue i reported
in another bug report ? It is the last open bug against the ocaml debian
packages.

BTW3, i plan to move the ocaml libdir from /usr/lib/ocaml to
/usr/lib/ocaml/. What would be your opinion on this issues.

Friendly,

Sven Luther

@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant