Alibaba stock gained ahead of its Q2 earnings due to broader optimism over technology stocks.