Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive

Switch linkage of ___tls_get_addr to extern(C).#2034

Merged
dlang-bot merged 1 commit intodlang:masterfrom
ibuclaw:externctls
Jul 3, 2019
Merged

Switch linkage of ___tls_get_addr to extern(C).#2034
dlang-bot merged 1 commit intodlang:masterfrom
ibuclaw:externctls

Conversation

@ibuclaw
Copy link
Member

@ibuclaw ibuclaw commented Jan 9, 2018

Rename to __tls_get_addr to keep same ABI.

This depends on dlang/dmd#7620 getting merged.

@ibuclaw ibuclaw added the Blocked label Jan 9, 2018
@ibuclaw ibuclaw requested a review from dnadlinger as a code owner January 9, 2018 21:52
@dlang-bot
Copy link
Contributor

dlang-bot commented Jan 9, 2018

Thanks for your pull request, @ibuclaw!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "master + druntime#2034"

@ibuclaw
Copy link
Member Author

ibuclaw commented Feb 11, 2018

Rebased now that dlang/dmd#7620 is in, lets see what the test-suite has to say...

@wilzbach
Copy link
Contributor

I guess today isn't your lucky day - Darwin_64_32 fails with:

../dmd/generated/osx/release/64/dmd -conf= -I../druntime/import  -w -de -dip25 -m32  -transition=complex -O -release -lib -ofgenerated/osx/release/32/libphobos2.a ../druntime/generated/osx/release/32/libdruntime.a std/array.d std/ascii.d std/base64.d std/bigint.d std/bitmanip.d std/compiler.d std/complex.d std/concurrency.d std/conv.d std/csv.d std/demangle.d std/encoding.d std/exception.d std/file.d std/format.d std/functional.d std/getopt.d std/json.d std/math.d std/mathspecial.d std/meta.d std/mmfile.d std/numeric.d std/outbuffer.d std/parallelism.d std/path.d std/process.d std/random.d std/signals.d std/socket.d std/stdint.d std/stdio.d std/string.d std/system.d std/traits.d std/typecons.d std/uni.d std/uri.d std/utf.d std/uuid.d std/variant.d std/xml.d std/zip.d std/zlib.d std/algorithm/comparison.d std/algorithm/iteration.d std/algorithm/mutation.d std/algorithm/package.d std/algorithm/searching.d std/algorithm/setops.d std/algorithm/sorting.d std/container/array.d std/container/binaryheap.d std/container/dlist.d std/container/package.d std/container/rbtree.d std/container/slist.d std/container/util.d std/datetime/date.d std/datetime/interval.d std/datetime/package.d std/datetime/stopwatch.d std/datetime/systime.d std/datetime/timezone.d std/digest/crc.d std/digest/digest.d std/digest/hmac.d std/digest/md.d std/digest/murmurhash.d std/digest/package.d std/digest/ripemd.d std/digest/sha.d std/experimental/allocator/common.d std/experimental/allocator/gc_allocator.d std/experimental/allocator/mallocator.d std/experimental/allocator/mmap_allocator.d std/experimental/allocator/package.d std/experimental/allocator/showcase.d std/experimental/allocator/typed.d std/experimental/allocator/building_blocks/affix_allocator.d std/experimental/allocator/building_blocks/allocator_list.d std/experimental/allocator/building_blocks/ascending_page_allocator.d std/experimental/allocator/building_blocks/bucketizer.d std/experimental/allocator/building_blocks/fallback_allocator.d std/experimental/allocator/building_blocks/free_list.d std/experimental/allocator/building_blocks/free_tree.d std/experimental/allocator/building_blocks/bitmapped_block.d std/experimental/allocator/building_blocks/kernighan_ritchie.d std/experimental/allocator/building_blocks/null_allocator.d std/experimental/allocator/building_blocks/package.d std/experimental/allocator/building_blocks/quantizer.d std/experimental/allocator/building_blocks/region.d std/experimental/allocator/building_blocks/scoped_allocator.d std/experimental/allocator/building_blocks/segregator.d std/experimental/allocator/building_blocks/stats_collector.d std/experimental/logger/core.d std/experimental/logger/filelogger.d std/experimental/logger/nulllogger.d std/experimental/logger/multilogger.d std/experimental/logger/package.d std/net/curl.d std/net/isemail.d std/experimental/checkedint.d std/experimental/typecons.d std/experimental/scripting.d std/range/interfaces.d std/range/package.d std/range/primitives.d std/regex/package.d std/regex/internal/generator.d std/regex/internal/ir.d std/regex/internal/parser.d std/regex/internal/backtracking.d std/regex/internal/tests.d std/regex/internal/tests2.d std/regex/internal/thompson.d std/regex/internal/kickstart.d std/c/linux/linux.d std/c/linux/socket.d std/c/windows/com.d std/c/windows/stat.d std/c/windows/windows.d std/c/windows/winsock.d std/windows/charset.d std/windows/syserror.d etc/c/curl.d etc/c/odbc/sql.d etc/c/odbc/sqlext.d etc/c/odbc/sqltypes.d etc/c/odbc/sqlucode.d etc/c/sqlite3.d etc/c/zlib.d std/c/fenv.d std/c/locale.d std/c/math.d std/c/process.d std/c/stdarg.d std/c/stddef.d std/c/stdio.d std/c/stdlib.d std/c/string.d std/c/time.d std/c/wcharh.d std/algorithm/internal.d std/internal/cstring.d std/internal/digest/sha_SSSE3.d std/internal/math/biguintcore.d std/internal/math/biguintnoasm.d std/internal/math/biguintx86.d std/internal/math/errorfunction.d std/internal/math/gammafunction.d std/internal/scopebuffer.d std/internal/test/dummyrange.d std/internal/test/range.d std/internal/unicode_comp.d std/internal/unicode_decomp.d std/internal/unicode_grapheme.d std/internal/unicode_norm.d std/internal/unicode_tables.d std/typetuple.d generated/osx/release/32/etc/c/zlib/adler32.o generated/osx/release/32/etc/c/zlib/compress.o generated/osx/release/32/etc/c/zlib/crc32.o generated/osx/release/32/etc/c/zlib/deflate.o generated/osx/release/32/etc/c/zlib/gzclose.o generated/osx/release/32/etc/c/zlib/gzlib.o generated/osx/release/32/etc/c/zlib/gzread.o generated/osx/release/32/etc/c/zlib/gzwrite.o generated/osx/release/32/etc/c/zlib/infback.o generated/osx/release/32/etc/c/zlib/inffast.o generated/osx/release/32/etc/c/zlib/inflate.o generated/osx/release/32/etc/c/zlib/inftrees.o generated/osx/release/32/etc/c/zlib/trees.o generated/osx/release/32/etc/c/zlib/uncompr.o generated/osx/release/32/etc/c/zlib/zutil.o
../dmd/generated/osx/release/64/dmd -conf= -I../druntime/import  -w -de -dip25 -m32  -transition=complex -O -release -defaultlib= -debuglib= generated/osx/release/32/libphobos2.a -run ../tools/checkwhitespace.d posix.mak win32.mak win64.mak std/array.d std/ascii.d std/base64.d std/bigint.d std/bitmanip.d std/compiler.d std/complex.d std/concurrency.d std/conv.d std/csv.d std/demangle.d std/encoding.d std/exception.d std/file.d std/format.d std/functional.d std/getopt.d std/json.d std/math.d std/mathspecial.d std/meta.d std/mmfile.d std/numeric.d std/outbuffer.d std/parallelism.d std/path.d std/process.d std/random.d std/signals.d std/socket.d std/stdint.d std/stdio.d std/string.d std/system.d std/traits.d std/typecons.d std/uni.d std/uri.d std/utf.d std/uuid.d std/variant.d std/xml.d std/zip.d std/zlib.d std/algorithm/comparison.d std/algorithm/iteration.d std/algorithm/mutation.d std/algorithm/package.d std/algorithm/searching.d std/algorithm/setops.d std/algorithm/sorting.d std/container/array.d std/container/binaryheap.d std/container/dlist.d std/container/package.d std/container/rbtree.d std/container/slist.d std/container/util.d std/datetime/date.d std/datetime/interval.d std/datetime/package.d std/datetime/stopwatch.d std/datetime/systime.d std/datetime/timezone.d std/digest/crc.d std/digest/digest.d std/digest/hmac.d std/digest/md.d std/digest/murmurhash.d std/digest/package.d std/digest/ripemd.d std/digest/sha.d std/experimental/allocator/common.d std/experimental/allocator/gc_allocator.d std/experimental/allocator/mallocator.d std/experimental/allocator/mmap_allocator.d std/experimental/allocator/package.d std/experimental/allocator/showcase.d std/experimental/allocator/typed.d std/experimental/allocator/building_blocks/affix_allocator.d std/experimental/allocator/building_blocks/allocator_list.d std/experimental/allocator/building_blocks/ascending_page_allocator.d std/experimental/allocator/building_blocks/bucketizer.d std/experimental/allocator/building_blocks/fallback_allocator.d std/experimental/allocator/building_blocks/free_list.d std/experimental/allocator/building_blocks/free_tree.d std/experimental/allocator/building_blocks/bitmapped_block.d std/experimental/allocator/building_blocks/kernighan_ritchie.d std/experimental/allocator/building_blocks/null_allocator.d std/experimental/allocator/building_blocks/package.d std/experimental/allocator/building_blocks/quantizer.d std/experimental/allocator/building_blocks/region.d std/experimental/allocator/building_blocks/scoped_allocator.d std/experimental/allocator/building_blocks/segregator.d std/experimental/allocator/building_blocks/stats_collector.d std/experimental/logger/core.d std/experimental/logger/filelogger.d std/experimental/logger/nulllogger.d std/experimental/logger/multilogger.d std/experimental/logger/package.d std/net/curl.d std/net/isemail.d std/experimental/checkedint.d std/experimental/typecons.d std/experimental/scripting.d std/range/interfaces.d std/range/package.d std/range/primitives.d std/regex/package.d std/regex/internal/generator.d std/regex/internal/ir.d std/regex/internal/parser.d std/regex/internal/backtracking.d std/regex/internal/tests.d std/regex/internal/tests2.d std/regex/internal/thompson.d std/regex/internal/kickstart.d etc/c/curl.d etc/c/odbc/sql.d etc/c/odbc/sqlext.d etc/c/odbc/sqltypes.d etc/c/odbc/sqlucode.d etc/c/sqlite3.d etc/c/zlib.d std/c/fenv.d std/c/locale.d std/c/math.d std/c/process.d std/c/stdarg.d std/c/stddef.d std/c/stdio.d std/c/stdlib.d std/c/string.d std/c/time.d std/c/wcharh.d std/c/linux/linux.d std/c/linux/socket.d std/c/osx/socket.d std/c/freebsd/socket.d std/c/windows/com.d std/c/windows/stat.d std/c/windows/windows.d std/c/windows/winsock.d std/windows/charset.d std/windows/syserror.d std/algorithm/internal.d std/internal/cstring.d std/internal/digest/sha_SSSE3.d std/internal/math/biguintcore.d std/internal/math/biguintnoasm.d std/internal/math/biguintx86.d std/internal/math/errorfunction.d std/internal/math/gammafunction.d std/internal/scopebuffer.d std/internal/test/dummyrange.d std/internal/test/range.d std/internal/unicode_comp.d std/internal/unicode_decomp.d std/internal/unicode_grapheme.d std/internal/unicode_norm.d std/internal/unicode_tables.d std/typetuple.d std/internal/windows/advapi32.d std/windows/registry.d std/c/linux/pthread.d std/c/linux/termios.d std/c/linux/tipc.d index.d
Error: program killed by signal 4
make: *** [checkwhitespace] Error 1

@ibuclaw
Copy link
Member Author

ibuclaw commented Feb 11, 2018

Does someone have a box I can use for debugging?

@thewilsonator
Copy link
Contributor

@ibuclaw this looks redundant since #2325 close?

@ibuclaw
Copy link
Member Author

ibuclaw commented Nov 30, 2018

Not for osx?

@thewilsonator
Copy link
Contributor

Whoops, I got carried away. Yes, please rebase.

@ibuclaw
Copy link
Member Author

ibuclaw commented Nov 30, 2018

I imagine that we still need to work out what is wrong with the compiler first. ;-)

@thewilsonator
Copy link
Contributor

I have an OSX box and could narrow the problem, or we could just ditch 32bit OSX :)

@wilzbach
Copy link
Contributor

I have an OSX box and could narrow the problem, or we could just ditch 32bit OSX :)

Apple deprecate support for 32-bit a long time ago and they will remove support for it completely with the next version:

At our Worldwide Developers Conference in 2018, Apple informed developers that macOS Mojave is the last version of macOS to run 32-bit apps.

https://support.apple.com/en-us/HT208436

So please let's not waste time on a dead horse.

@jacob-carlborg
Copy link
Contributor

or we could just ditch 32bit OSX. Apple deprecate support for 32-bit a long time ago and they will remove support for it completely with the next version. So please let's not waste time on a dead horse

Yes please. But there might be necessary to convenience some other people.

@thewilsonator
Copy link
Contributor

OSX32-bit support was dropped can this be closed or merged?

@atilaneves
Copy link
Contributor

OSX32-bit support was dropped can this be closed or merged?

I would guess so. Anyone else?

@ibuclaw
Copy link
Member Author

ibuclaw commented Jun 28, 2019

There's still the compiler component to remove.

@thewilsonator
Copy link
Contributor

Does that need to be done before this?

@ibuclaw ibuclaw requested a review from jacob-carlborg as a code owner July 2, 2019 19:31
@ibuclaw
Copy link
Member Author

ibuclaw commented Jul 2, 2019

I wouldn't have thought so. From memory, the compiler side is just a special case for recognizing and not mangling symbols named extern(D) ___get_tls_addr(void*).

@jacob-carlborg
Copy link
Contributor

I wouldn't have thought so. From memory, the compiler side is just a special case for recognizing and not mangling extern(D) ___get_tls_addr(void*).

So if it's extern(C) it will just work?

@ibuclaw
Copy link
Member Author

ibuclaw commented Jul 2, 2019

I'm rebasing to have another look at what the error is. Switching from extern(D) to extern(C) would change the ABI on 32bit (pointer passed in register vs. pushed on stack), maybe there's something else in the compiler that needs to change in lock-step.

@ibuclaw
Copy link
Member Author

ibuclaw commented Jul 2, 2019

Great, the testsuite passes now because 32bit Darwin is disabled...

@ibuclaw
Copy link
Member Author

ibuclaw commented Jul 3, 2019

Might as well merge this then? I'll see if I can track down possible OSX 32-bit problems in the teardown PR that will be sent to dmd.

What I'll be notably looking for it anything that suggests the D calling convention around ___tls_get_addr.

@dlang-bot dlang-bot merged commit 0dd082b into dlang:master Jul 3, 2019
@ibuclaw ibuclaw deleted the externctls branch July 3, 2019 18:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants