Skip to content

Fix build for ld.bfd in anticipation of setting up CI#10

Merged
lidavidm merged 1 commit into
apache:mainfrom
lidavidm:cpp-build
Jun 9, 2022
Merged

Fix build for ld.bfd in anticipation of setting up CI#10
lidavidm merged 1 commit into
apache:mainfrom
lidavidm:cpp-build

Conversation

@lidavidm

@lidavidm lidavidm commented Jun 7, 2022

Copy link
Copy Markdown
Member

Builds on #7.

The driver manager and drivers define the same symbols. Normally,
this means that if the driver manager loads a driver, and then the
driver attempts to resolve ADBC functions (e.g. to populate the
driver function pointer table), the dynamic linker will actually
resolve the driver manager's symbols, which is a problem.

Previously, we used attribute(visibility("protected")). But
it turns out ld.bfd doesn't like this, complaining about an invalid
relocation (ld.mold worked fine). The driver manager could use
RTLD_DEEPBIND, but this doesn't work with ASan. We could also try
-Bsymbolic(-functions) too, but this is additional work for the
build process. So instead, just take the tedious-but-easy route
and define each symbol twice.

The driver manager and drivers define the same symbols.  Normally,
this means that if the driver manager loads a driver, and then the
driver attempts to resolve ADBC functions (e.g. to populate the
driver function pointer table), the dynamic linker will actually
resolve the driver manager's symbols, which is a problem.

Previously, we used __attribute__(visibility("protected")).  But
it turns out ld.bfd doesn't like this, complaining about an invalid
relocation (ld.mold worked fine).  The driver manager could use
RTLD_DEEPBIND, but this doesn't work with ASan.  We could also try
-Bsymbolic(-functions) too, but this is additional work for the
build process.  So instead, just take the tedious-but-easy route
and define each symbol twice.
@lidavidm lidavidm marked this pull request as ready for review June 9, 2022 14:55
@lidavidm lidavidm merged commit fc17ed0 into apache:main Jun 9, 2022
@lidavidm lidavidm deleted the cpp-build branch November 17, 2022 16:19
felipecrv added a commit to felipecrv/arrow-adbc that referenced this pull request May 6, 2025
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

Successfully merging this pull request may close these issues.

1 participant