Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Dec 08 21:50
    kinke commented #3882
  • Dec 08 21:50

    kinke on master

    wasm: Add new default lld switc… (compare)

  • Dec 08 21:50
    kinke closed #3882
  • Dec 08 21:49
    kinke auto_merge_disabled #3882
  • Dec 08 19:37
    kinke auto_merge_enabled #3882
  • Dec 08 19:37
    kinke edited #3882
  • Dec 08 19:34
    ryuukk commented #3882
  • Dec 08 19:34
    ryuukk synchronize #3882
  • Dec 08 19:06
    kinke commented #3882
  • Dec 08 19:03
    ryuukk commented #3882
  • Dec 08 19:03
    ryuukk synchronize #3882
  • Dec 08 18:59
    kinke commented #3882
  • Dec 08 18:50
    ryuukk commented #3882
  • Dec 07 19:50
    ryuukk synchronize #3882
  • Dec 07 19:39
    kinke commented #3882
  • Dec 07 19:38
    kinke commented #3882
  • Dec 07 17:43
    JohanEngelen commented #3882
  • Dec 07 17:41
    JohanEngelen commented #3882
  • Dec 07 17:41
    JohanEngelen commented #3882
  • Dec 07 15:06
    Geod24 commented #3882
Crispin Wellington
@retrogradeorbit
ok, with -betterC I get:
$ ldc2 -mtriple=wasm32-unknown-unknown-wasm -betterC src/d/wasm.d src/d/point.d src/d/bresenhamline.d
src/d/point.d(1): Error: TypeInfo cannot be used with -betterC
Martin Kinkelin
@kinke
These symbols are in druntime. If you want to play with non-betterC wasm, see e.g. https://forum.dlang.org/post/vndiggkebmwqvnhafqtl@forum.dlang.org.
Crispin Wellington
@retrogradeorbit
OK interesting. Will give it a try.
any info on what TypeInfo is and why my program is using it? (I dont mention it anywhere)
I'm doing a Point[] buffer = new Point[size]; in bresenhamline.d. Is that needing runtime type info?
(point is just a struct with x and y params)
Martin Kinkelin
@kinke
TypeInfos are essential for the D GC.
Crispin Wellington
@retrogradeorbit
ahhh. can I mark something to be not managed by the GC? Im going to need to do that anyway as I have to share the wasm heap with the JS runtime.
I am creating structures in wasm that I will be reading and manipulating in JS
so basically I want to create that buffer manually. leave it on the heap when the function returns. and have another function later that calls delete on it
Crispin Wellington
@retrogradeorbit
I annotate the function @nogc but I still get the TypeInfo error
Martin Kinkelin
@kinke
I'm not familiar with the details of skoppe's port, but I assume manually allocating via malloc works in that case (auto buffer = (cast(Point*) malloc(size * Point.sizeof))[0 .. size];). And later freeing via free(buffer.ptr).
Joseph Rushton Wakeling
@WebDrake
Is there a reason why users of the binary package downloads should need to have libxml2 or libicu55 installed? (I'm experimenting with a new snap package that just takes the prebuilt binaries, and snapcraft claims these libs are required.)
Martin Kinkelin
@kinke
libxml2 is a dependency of LLVM (if detected on the system building LLVM), and AFAIK required to generate Windows manifest files, e.g., when cross-compiling to Windows targets.
Andrea Fontana
@trikko

Hi. I'm trying to create a cross compiler for raspberry pi.
I followed the instructions I found on wiki to build runtime and phobos.

It seems to works. It create a binary but it won't run on raspberry.
It says:

./wall2: /lib/arm-linux-gnueabihf/libm.so.6: version `GLIBC_2.29' not found (required by ./wall2)

It seems that libc on my raspberry is v2.28 rather than 2.29:
libc6 | 2.28-10+rpi1 | http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages

I think this is the problem. How can I solve this?

Andrea Fontana
@trikko
Maybe I should try to do the same thing from a docker with debian buster?
Andrea Fontana
@trikko
It works using a docker. Great!
ben.txt
@bentxt
Hi! I'm interested in d and the ldc compiler and like to try out a relatively simple scenario: create a static library in d which than is linked and then called by a main.c file. I'm at the point where I blindly test all combinations of ldc2 and gcc commands because I don't really understand how to reference the d runtime. Could someone help me a little over here? thanks a lot ...
Johan Engelen
@JohanEngelen
@bentxt When you compile a simple helloworld.d, run ldc -v helloworld.d . At the end, you'll see the commandline that is passed to GCC. On that commandline you will see how to pass druntime and phobos to gcc to link to a static library written in D. Make sure you initialize the druntime. See: https://forum.dlang.org/post/biwotleipkojnngiukbf@forum.dlang.org
ben.txt
@bentxt
@JohanEngelen : thanks a lot, I'm one step further ...
Bob Assembly
@MassMessage
Hey guys, where can I find the documentation/references about variables like heap_base, data_end, etc? I may need to write my own malloc(), so I need to see those
J.V.
@JV81608177_twitter
Hi guys, where can i learn more about the D compiler internals ?
Nicholas Wilson
@thewilsonator
If you want to know more about the frontend I'd recommend joining the dlang slack channel (if you PM me an email address I can add you). This is the place for discussing LDC which serves as an intermediary between the frontend and LLVM.
RUSshy
@RUSshy
Hi, how can i tell LDC to statically link all required dlls? vcruntime things
Martin Kinkelin
@kinke
You probably don't have an installed MSVC toolchain if the MS runtime isn't linked statically by default, see README.txt.
RUSshy
@RUSshy
i do have a vs install (vs2019), that's weird that it doesn't find it, hmm
oh, do i have to build using the native cmd line tool?
RUSshy
@RUSshy
i noticed something interesting:
Linking...
LINK : warning LNK4098: defaultlib 'libcmt' conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib 'libvcruntime' conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
RUSshy
@RUSshy
i'm linking with a GLFW.lib, could that be the issue?
Martin Kinkelin
@kinke
Yes, that's very likely. You can use /Zl with the MS compiler to prevent it from embedding the default lib, or compile with /MT to select the static one. - The switch for LDC is -mscrtlib.
RUSshy
@RUSshy
image.png
i compiled with -mscrtlib=msvcrt flag, but it still complain
image.png
RUSshy
@RUSshy
@kinke shouldn't be the job of LDC to statically link that one? or libs will all have the duplicated symbols
what do i have to put in my dub.json file?
RUSshy
@RUSshy
i compiled glfw from source with /MT, still same issue
i feel like i am missing something obvious, but i fail to see what
RUSshy
@RUSshy
@kinke it now works, i had to add "libs-windows": ["user32", "gdi32", "LIBCMT", "opengl32"],
libcmt
Martin Kinkelin
@kinke
Yeah, -mscrtlib=msvcrt is the dynamic one, so don't blame LDC. ;)
Gratian Lup
@gratianlup
Hi, I'm working on a tool that is extremely useful for working with compiler IR and the plan is to open source it next year (I work on the MSVC optimizer). It's a Windows-based UI tool, but does work well on Linux using Wine with a couple of distributions I tried, including Ubuntu. What I wonder is what OS most LLVM devs use and if there was ever such a survey done? I assume most are not using Windows, but do wonder about the Linux/Mac OS split, and then for Linux what distro. If I'd make a survey, would people answer to it? :) Knowing this would help making sure the tool works fine for LLVM devs
Petar Kirov
@PetarKirov
I'm not an LLVM dev, but I'd say that the distribution is similar to the general distribution of developers. Some of the most popular distros are: Ubuntu, Debian, Arch Linux, NixOS, Fedora, Gentoo, to name a fee.
to name a few*
If you're building a UI app, I suggest using a cross-platform UI framework. @gratianlup what did you use?
Jon Degenhardt
@jondegenhardt
Does the Arch Linux pacman distribution of LDC include the LTO versions of the phobos and druntime libraries? A tsv-utils user is trying to build on Arch Linux using the -flto=thin -defaultlib=phobos2-ldc-lto,druntime-ldc-lto flags and getting failures to find libraries. This is when using the Arch Linux LDC distribution. It works when building with the packages provided on the GitHub releases page. I'm guessing the Arch Linux may simply not include the LTO versions of these libraries, but I'm not an Arch Linux user, so not sure.
Jon Degenhardt
@jondegenhardt
Another possibility is that the LTO versions of the libraries are included, but the Arch Linux ldc2.conf file is not setup correctly to support these build options.
Martin Kinkelin
@kinke
According to the files list of https://archlinux.org/packages/community/x86_64/liblphobos, the libs are included, so it's probably an ldc2.conf issue. The user might need to add -link-defaultlib-shared=false if it defaults to true in the config.
Jon Degenhardt
@jondegenhardt
Thanks @kinke !
Jon Degenhardt
@jondegenhardt
@kinke FYI - Turned out to be two issues on Archlinux. As suggested, one was setting -link-defaultlib-shared=false to override the ldc2.conf file. The other was change the Archlinux builds of druntime and phobos libs to avoid stripping symbols.