From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 34067 invoked by alias); 25 Dec 2017 04:58:09 -0000 Mailing-List: contact java-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-owner@gcc.gnu.org Received: (qmail 34055 invoked by uid 89); 25 Dec 2017 04:58:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=H*f:sk:CALQF7Z, H*i:CAAD4mYiQ5Rs, r0b0t1, H*f:sk:Xw6Ltrn X-HELO: mail-wr0-f177.google.com Received: from mail-wr0-f177.google.com (HELO mail-wr0-f177.google.com) (209.85.128.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 25 Dec 2017 04:58:07 +0000 Received: by mail-wr0-f177.google.com with SMTP id f8so21620648wre.4 for ; Sun, 24 Dec 2017 20:58:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=4mzRbdQUTGjtJEKdjhs2uhezamiJ3xIAo6DOEd6pYzk=; b=gI79zlWOqc59da2MWwnv4SSkpR3eg3uem6skXuouc5TlwnN7xx7nWx+dwBMJwoQIZz aYZ9R70lWfOhia2IJBoUrM2VH+3L96CShH4PnElXKfOd8qJ34Tn8vfFEItkm38U+LX3m EYkR85UjRz8Tzr+K2z/FybdL1O4XphNB8wTNqTvCLNYcohG3Ih2HQPwbaTcMtp6fYZLK A92cKDrslcPmQ58hQL2ltEEpA92ssIQY/GuF6muUq3xtt6UH+jZ6N8L/YHVj6EMR3YyK ZnvT34I3HF1ERsQBFzrv3ZZQ5OEQ13IL/xDmOJmDufaWy2rVxE7KyLgpiILM6HqFrzXu EzYA== X-Gm-Message-State: AKGB3mLjFLPJaZOAFf4vpqBVPGgbwwGk73AnxJ1hPfznoB6w8phhpgvo sAi1syJ4Gqv/dpRxmIBwJhDS0iQ8MXJDfsqyreA= X-Google-Smtp-Source: ACJfBot3FuU4+VrZwbNCawgXlxiKkncittKRY4voEZgD7BsIQ5IUWHY9fVztMsk1tXyCKDM+wzt64sucFcCs+HY8aDM= X-Received: by 10.223.132.163 with SMTP id 32mr15985773wrg.283.1514177885440; Sun, 24 Dec 2017 20:58:05 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.169.227 with HTTP; Sun, 24 Dec 2017 20:58:05 -0800 (PST) In-Reply-To: References: From: Yale Zhang Date: Mon, 25 Dec 2017 04:58:00 -0000 Message-ID: Subject: Re: add support for x86_64-w64-mingw32 and cut the fat from libgcj To: R0b0t1 Cc: java@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-12/txt/msg00003.txt.bz2 Hurray, this list is still alive! Here's what I plan to do. If I don't hear from any maintainers in the next 2 weeks, I'll submit the MingW64 patch to the GCC Bugzilla. But not much hope there because I already submitted a few other bugs almost all still remain as "unconfirmed". So then I'll just post it on my Google personal site or maybe write something on instructables.com. Or maybe I already did enough by uploading to this list. "Do your changes make it impossible to use the functionality you cut out?" Correct, I would not propose adding this to libjava as is. Most of the bloat can't be removed by the compiler because it might be used or even if it's never used, the compiler doesn't know any better. an example would be UI: System() { if (showVMConsole) { // show VM console GUI } } I haven't proven this but that's my guess how a simple hello world program drags Swing into the EXE. As you suspected, there could be unused dead code that the linker should remove. I haven't confirmed any cases. For dead code removal to happen, I think it's necessary to compile with -ffunction-sections and -fdata-sections and link with --gc-sections. I can check if they're on and if not, how much additional space is saved by enabling them. So, what changes did you want to make to GCJ? On Sun, Dec 24, 2017 at 7:33 PM, R0b0t1 wrote: > On Sun, Dec 24, 2017 at 1:44 PM, Yale Zhang wrote: >> Greetings. I have a patch that allows GNU java to target MingW64 >> (host=GNU/Linux only). Are you guys still taking patches now that Java >> has been removed from GCC 7? Or would it be more appropriate to host >> it on my own website or instructables.com? >> > > My questions in a similar vein led to the suggestion to use the last > version that supported GCJ. Development on this version has stopped. > > On the other hand, I am interested in your work, and know of at least > a few people who would be; hosting it publicly would be a good idea. > If GCC could accept the patches I suspect it would be beneficial, but > the people to review your contributions may no longer exist. > >> I also have another patch that cuts all the GUI, cryptography, and non >> UTF8/16 charset support from libgcj. This reduces the size of >> statically linked EXEs a lot (~27MiB to 4.5 MiB for a hello world >> program). This is important for a legacy utility that other developers >> use on Windows and who don't want to install a Java runtime. >> >> Commenting out and deleting code is a crude way to do, I know. Should >> use conditional compilation and even explore what's causing GUI code >> to be dragged into a hello world program. Maybe dead code removal >> isn't working (need to compile with -ffunction-sections and >> --gc-sections?) >> > > Do your changes make it impossible to use the functionality you cut > out? It is not really my place to say, but to me, that would be > unsuitable for inclusion in GCC proper. > > I shouldn't guess, but it seems to me like the default classpath may > just be copied into the executable. Optimization passes may not be run > on it. > > Cheers, > R0b0t1