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

Problem: undefined symbol _xdl_regexec_buf when linking with libxdiff #5

Open
yrashk opened this issue Jan 19, 2025 · 3 comments
Open

Comments

@yrashk
Copy link

yrashk commented Jan 19, 2025

(referenced from xdiffi.c)

This fixes the problem, but to be honest I am not sure why, it should have picked up inlined from the header xdl_regexec_buf 🤔

diff --git a/git-xdiff.h b/git-xdiff.h
index 4091d22..673b5b6 100644
--- a/git-xdiff.h
+++ b/git-xdiff.h
@@ -64,7 +64,7 @@ inline int xdl_regexec_buf(
 # define xdl_regex_t regex_t
 # define xdl_regmatch_t regmatch_t
 
-inline int xdl_regexec_buf(
+static inline int xdl_regexec_buf(
 	const xdl_regex_t *preg, const char *buf, size_t size,
 	size_t nmatch, xdl_regmatch_t pmatch[], int eflags)
 {

When not linking but simply building xdiff, this error does not happen, but I can see that it is an undefined symbol (using nm):

                 U _xdl_regexec_buf
@ethomson
Copy link
Member

Apologies; we split out xdiff from git / libgit2 so that people could (in theory) package it separately. It was motivated by libgit2/libgit2#6660 and some other libgit2 issues and PRs. But you may be the first person to actually use it!

It looks like we missed some changes to keep it isolated. I think that your change is correct.

@JanMarvin
Copy link

I have an R package bundling the lib at https://github.com/JanMarvin/libxdiffR with a similar change (and others depending on the availability of regex functions). Thanks for unbundling!

@ethomson
Copy link
Member

Should be fixed by #6; thanks for the information @yrashk and @JanMarvin

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

3 participants